A battle over whether to expand Medicaid that has divided Arizona Republicans for nearly two years will soon advance to the state’s highest court.

The Arizona Supreme Court agreed to hear a challenge from Republican Gov. Jan Brewer, who is seeking to protect the state’s use of federal dollars to expand Medicaid last year.

“With the Court’s decision, Arizona is one step closer to ending the baseless lawsuit, thereby allowing the state to focus exclusively on implementing one of the most critical and meaningful health care policies to be enacted in years,” Brewer wrote in a statement.

The Medicaid expansion — which was expected to provide coverage to about 300,000 residents — has been the center of a lengthy courtroom battle between Brewer and the leaders of the GOP-controlled House and Senate.

The Arizona legislature passed the bipartisan measure in June 2013, which immediately inflamed conservative lawmakers who condemned it as an encroachment by the federal government.

A group of Republicans then filed a lawsuit against the measure, arguing that the expansion qualifies as a tax and needed to be approved by two-thirds of legislators. The bill had been passed with a simple majority.

A county superior court judge threw out the challenge in February 2014, but the decision was overturned by the state’s appeals court just two months later.

Brewer’s position on Medicaid stands in stark contrast to those of the chief executives of states such as Texas and Louisiana. Republican Govs. Rick Perry and Bobby Jindal have firmly refused to take federal dollars as part of the Obama administration’s plan to reform Medicaid, though a majority of state leaders have agreed to expand Medicaid.

Brewer has just weeks left in office, likely to be replaced by GOP nominee Doug Ducey, who has promised to “control the costs” of the Medicaid expansion. The state’s primary on Tuesday resulted in victories by several lawmakers who had supported the legislature’s plan to expand Medicaid.

Twenty-seven states expanded Medicaid in 2014, with the federal government covering the brunt of the costs.