WASHINGTON — Senate Republicans on Thursday unveiled a draft of their legislation to revamp the government's role in the nation's health care system.

The bill, written largely in secret, includes big reductions to Medicaid, defunds Planned Parenthood, eliminates the Obamacare mandate requiring individuals buy insurance, and slashes taxes on the wealthy.

The details of the bill had been tightly held by Republican leaders as Senate Majority Leader Mitch McConnell wrote legislation that aims to appeal to his most conservative members and the moderates in his 52-member conference.

President Donald Trump tweeted his support for the bill on Thursday evening, but indicated he's open to changes.

I am very supportive of the Senate #HealthcareBill. Look forward to making it really special! Remember, ObamaCare is dead. — Donald J. Trump (@realDonaldTrump) June 22, 2017

With no Democrats expected to support a repeal of the Affordable Care Act, McConnell can only afford to lose two votes for the measure to pass. However, four Republicans said Thursday they will oppose the bill without changes.

“When legislation does come to the floor, it will present Senate Democrats with another opportunity to do what’s right for the American people. They can choose to keep standing by as their failing law continues to collapse and hurt more Americans, but I hope they will join with us instead to bring relief to the families who have struggled under Obamacare for far too long,” McConnell said Thursday.

Related: Inside the Health Care Bill: Trump Wanted 'Heart.' He Didn't Get It

Republican senators filed into a room in the Capitol on Thursday morning, and sat in chairs lined up in rows to listen to a closed-door presentation of a "discussion draft" of the legislation that could be voted on as early as next week.

They emerged from their meeting with mixed reactions; some conservatives were not pleased.

"This is not Obamacare repeal," said Sen. Ron Johnson (R-Wisc).

Sen. John Thune (R-S.D.) and a member of Republican leadership said that changes are still likely before it's put to a vote.

"We've got members who are going to be interested in looking at the text and looking to see what they can do to refine and improve and dial things accordingly to try and figure out how we get 50 votes," Thune said. "There's a lot of areas that are probably subject to dials — tax credit, Medicaid."

Protests erupted around the Capitol complex against the bill. And Democrats immediately slammed the measure.

"The way this bill cuts health care is heartless," said Senate Democratic Leader Chuck Schumer on the Senate floor. "The president said the House bill is mean. The Senate bill may be meaner."

Capitol Police remove a woman from a protest in front of the office of Senate Majority Leader Mitch McConnell on Thursday. Mark Wilson / Getty Images

Former President Barack Obama weighed in on the bill aimed at dismantling his signature achievement later Thursday afternoon in a lengthy Facebook message.

"I was careful to say again and again that while the Affordable Care Act represented a significant step forward for America, it was not perfect, nor could it be the end of our efforts — and that if Republicans could put together a plan that is demonstrably better than the improvements we made to our health care system, that covers as many people at less cost, I would gladly and publicly support it," Obama wrote.

"The Senate bill, unveiled today, is not a health care bill. It’s a massive transfer of wealth from middle-class and poor families to the richest people in America. It hands enormous tax cuts to the rich and to the drug and insurance industries, paid for by cutting health care for everybody else," he added.

Protesters with disabilities, including many in wheelchairs, jammed the hall outside of McConnell's office until removed by police. At least 15 people were arrested.

The major change to health care comes in the form of Medicaid.

The bill winds down the expanded Medicaid program under Obamacare after 2020 — a longer timeline than the House bill that was passed in May. But it also makes deeper cuts to the program in the long run by changing the federal funding allocation formula for states to receive fewer federal dollars for Medicaid recipients.

The bill also allows states to implement work requirements for Medicaid recipients. It's an attempt at a compromise to appease those Medicaid advocates like Sens. Rob Portman of Ohio and Susan Collins of Maine, as well as conservatives like Sens. Mike Lee of Utah and Ted Cruz of Texas.

But Ohio Gov. John Kasich, one of 11 GOP governors who elected to expand the program in their state under Obamacare, said in a statement that he had "deep concerns" about the Senate bill, especially with regard to the "resources needed to help our most vulnerable, including those who dealing with drug addiction, mental illness and chronic health problems and have nowhere else to turn."

Related: Read the Senate Health Bill

Some major components of Obamacare are kept in place, however.

Republican senators say the bill makes no changes in the law protecting individuals with pre-existing conditions from being denied insurance. Meanwhile, young adults up to the age of 26 are able to stay on their parents' insurance.

The measure also keeps a similar program to help people who purchase insurance out of pocket, known as the individual marketplace, afford the insurance through tax credits based on income, combining the ideas behind Obamacare and the House bill. The House bill gave people tax credits based on age, severely impacting older Americans who would see premiums rise by more than 700 percent, according to analysis of the bill.

Planned Parenthood is defunded in this bill and it restricts tax credits from being used for insurance plans that provide abortion.

And taxes on the wealthy are repealed. A .9 percent tax on income for those making more than $250,000 per year is repealed in 2022, while a three percent tax on investment income is repealed retroactively, going back to 2016.

In an effort to prop up the Obamacare marketplace where insurance companies are exiting the market in some regions, leaving few or no options for people, this bill would provide an additional $15 billion per year until 2020 and $10 billion per year in 2020 and 2021 to insurance companies for them to stay in the marketplace to provide insurance in the individual market.

Senate Majority Leader Mitch McConnell of Ky. arrives on Capitol Hill on June 22, 2017, in Washington. Andrew Harnik / AP

Related: Here's What to Look For in the Senate Health Care Bill

According to Senate rules, the Senate can vote on this bill only after it is scored by the non-partisan Congressional Budget Office. Senators expect that analysis to be done as early as Friday or perhaps Monday.

The CBO analysis of the House bill says that 23 million people would lose insurance in the next decade under their bill, which President Donald Trump called "mean" in a meeting with senators earlier this month.