HELENA, Mont. (AP) — The Montana Legislature wrapped up its 2021 session Thursday having passed a $12 billion two-year budget, set a framework for spending $2 billion in federal stimulus money over the next four years and implemented policy to enact the state's voter-approved recreational marijuana law.

The session began with clashes over whether lawmakers should be required to wear masks to prevent the spread of the coronavirus — the Republican majority decided against it — and ended with everyone in the state 16 and over being eligible for a COVID-19 vaccination and a rebounding economy.

For the first time, lawmakers were allowed to participate remotely and members of the public could testify on bills via video conferencing in an effort to limit the spread of the coronavirus.

Republicans held a two-thirds majority in the Legislature and, for the first time in 16 years, the state also had a Republican governor, giving conservative lawmakers clearance to pass legislation that had been vetoed by previous Democratic governors.

Lawmakers passed bills to restrict abortions, relax gun restrictions and reshape the judiciary while they declined to confirm several people nominated to posts and commissions by former Gov. Steve Bullock, including a District Court judge who was a former Democratic state lawmaker.

Montana's budget allows a less-than-inflationary 1.25% annual increase per year, and is smaller than the budget requested by Gov. Greg Gianforte, said Republican Rep. Llew Jones of Conrad, chair of the House Appropriations Committee.

Montana will have a $350 million ending fund balance, $122 million in a savings account, $150 million in a capital development account and a full fire fund with $100 million, Jones said Thursday. The budget also includes $120 million in tax cuts.

“With this fiscally strong and conservative budget, Montana is poised to emerge from the pandemic with strong economic growth and return money back to taxpayers,” Kurt Alme, the governor's budget director, said in a statement.

Democrats criticized Republicans for eliminating the 12-month eligibility for Medicaid expansion and requiring people to certify their eligibility more than once a year. They also criticized the majority for setting aside $285,000 to investigate the judicial branch, allocating $100,000 for lawsuits that are expected to challenge new election laws and spending $90,000 to investigate abortions paid for by Medicaid.

A new law to eliminate the Judicial Nomination Commission and allow the governor to directly fill judicial vacancies between elections is already being challenged on a constitutional basis. The legislative investigation of the judicial branch grew out of the discovery of emails among District Court judges who opposed the bill to eliminate the commission and allow the governor to fill judicial vacancies between elections.

Lawmakers also passed a backup bill to add eight more lay members, appointed by the governor, to the seven-member Judicial Nomination Commission if eliminating the commission is found to be unconstitutional. The backup bill was amended late in the session to add that judicial officers can't oversee legal challenges to legislation if they have expressed an opinion on that legislation.

Bullock had filled three judicial vacancies after the 2019 legislative session, meaning they still had to be confirmed by the Senate in 2021. The Senate confirmed District Judge Peter Ohman in Gallatin County and rejected the nomination of District Judge Michele Reinhart Levine, a former state representative, in Cascade County.

On the final day of the session, the Senate Judiciary Committee, on a party-line vote, recommended against confirming District Judge Chris Abbott in Lewis and Clark County. A motion to accept the committee's decision failed on a tie vote. Later, as Abbott sat in the gallery, the Senate reconsidered, and he was confirmed on a 27-23 vote.

Gianforte will appoint a replacement for Reinhart Levine after taking applications and seeking public comment.

Montana lawmakers also passed a bill to ask voters if they want to elect Supreme Court justices by districts.

The Legislature rejected a bill that would have given the state more latitude in selecting drugs to carry out lethal injections, effectively leaving the death penalty on hold in Montana based on a 2015 court decision.

The Legislature also passed bills:

— To provide compensation for people who have been wrongly convicted of felony crimes and exonerated.

— Extending the Missing Indigenous Persons Task Force, which recommends policies and improves collaboration between law enforcement agencies to address missing persons cases.

— Limiting the powers of the governor and local health boards in dealing with future pandemics and any potential stimulus spending. Republicans argued Bullock and health boards had too much authority in closing businesses and churches, or limiting capacity and operating hours, as well as enacting mask mandates to try to limit the spread of the coronavirus.

— Ending same-day voter registration and requiring additional identifying information from those who use a student ID to register and vote. The Montana Democratic Party has filed a legal challenge.