The Arizona Legislature embraced a signature component of President Barack Obama's health care law Thursday after a drawn out battle that divided the state's Republican leadership and saw GOP Gov. Jan Brewer work closely with Democratic lawmakers to expand Medicaid access.

The Legislature passed Brewer's $8.8 billion state budget and Medicaid expansion after months of stalled negotiations, tense debates and political maneuvering from both sides.

Brewer called it a "sweet victory" for Arizona's budget and its people. The expansion will provide health insurance to an additional 300,000 poor Arizonans under a key provision of the Affordable Care Act.

"The day has been a red-letter day for the people of Arizona," Brewer said. "It was a win, win, win all the way around."

A newly formed coalition of Democrats and moderate Republicans worked closely with Brewer to push back against the conservative leaders who run the Legislature and had blocked debate on the Medicaid expansion for six months. Lawmakers worked through the night Wednesday to get the plan through the House, and the Senate vote came hours later Thursday afternoon.

Brewer, an early critic of the Affordable Care Act, surprised the nation when she embraced the Medicaid expansion as the law of the land in her State of the State address in January. She noted that rejecting an expansion would mean Arizona taxpayers would subsidize care for those in other states while receiving no benefits themselves.

The expansion is expected to help reduce the amount of uncompensated care hospitals must absorb and help cut what Brewer called a hidden health care tax that people who buy insurance pay, through higher premiums, to cover others' care.

After the Legislature secured her political win, Brewer softened her support for the health care law Thursday.

"Medicaid was here long before Obama health care. I have never liked Obama health care," she told reporters after the vote. "It has nothing to do with Obama health care."

Republicans control the Legislature and all statewide elected offices in Arizona, but the Medicaid fight highlighted internal fractures between those who want smaller government and others who, like Brewer, say broader health care access is good for the state.

"The bottom line here is greed," said Sen. Al Melvin, a Tucson Republican who is running for governor and voted against the Medicaid expansion. "The people who want this know in their hearts that Obamacare is going to collapse under its own weight."

The expansion is optional under last year's Supreme Court decision upholding the health care law, and many Republican governors rejected it.

In all, 23 states plus Washington, D.C., are moving ahead with the expansion, while 15 states have turned it down. Another 12 states are still weighing options.

Nearly all the states refusing are led by Republicans. Several of the states accepting have Republican governors, but most are led by Democrats.

Washington will pick up the entire cost of the expansion for the first three years and 90 percent over the longer haul. It's estimated that less than $100 billion in state spending could trigger nearly $1 trillion in federal dollars over a decade.

In Arizona, Republican leaders in the Legislature called the expansion a massive government overreach that would drive the federal government deeper into debt. They predicted the government promises of paying for the expansion would turn out to be false.

"This is the biggest mistake we've made in the Arizona Legislature this year and maybe ever," said Republican Sen. Kelli Ward, of Lake Havasu City. "It's going to decrease the quality of care in Arizona, it's going to decrease access of care in Arizona and it's going to increase costs for all of us."

Republican Sen. Michele Reagan chastised conservative business leaders who sided with Brewer in the health care debate.

"I wonder how many businesses would make a decision to fund something so large and so unknown for an indefinite amount of time without a check and balance guarantee in place?" said Reagan, of Scottsdale.

The Senate president and House speaker had blocked action on the expansion for months, with the Senate finally adopting it in May. Speaker Andy Tobin continued to stall as he tried to get Brewer to compromise, but she finally had enough Tuesday and called the Legislature into a surprise special session. Both chambers started afresh Tuesday evening.

As the debate progressed, Brewer's allies refused to so much as answer questions on the floor or discuss provisions in the proposed budget. Instead, lawmakers exchanged barbs and policy rebuttals on Twitter long into the night as conservatives ranted on the floor.

"I've never seen the case where a governor has rolled over her own party because she was throwing a temper tantrum," said Republican Rep. Eddie Farnsworth, of Gilbert.

Senate President Andy Biggs said lawmakers had little information about what was in the budget before passing it. He said he only learned of the special session after a reporter called him Tuesday afternoon.

"I am deeply and profoundly disappointed at the manner at which this came down," he said.

Brewer dismissed the insults, predicting that all would be forgiven and Republican leaders would move forward together.

"Tomorrow they'll probably say `I'm sorry' or we will just forget it," she said. "I just try to listen and let it go."

The Medicaid plan would cover people making between 100 percent and 138 percent of the federal poverty level and restore coverage to more than 100,000 childless adults who lost Medicaid coverage because of a state budget crunch. About 1.3 million Arizonans already are covered by the state's plan.