Paul Ryan before AHCA vote
Speaker of the House, Paul Ryan, departs a meeting at the US Capitol before a vote to repeal Obamacare REUTERS/Kevin Lamarque

The US House of Representatives has narrowly passed the American Health Care Act, a bill to replace the Affordable Care Act, commonly known as Obamacare.

In a vote that was uncertain up until the very end, the bill passed by 217 to 213 votes as Republicans who had rejected a previous incarnation of the bill switched their votes.

The bill now moves to the Senate where it is expected to face huge difficulties.

In a statement, the American Civil Liberties Union called the move a "giant step backwards".

"This cruel bill cuts off access to reproductive health care for millions who depend on Planned Parenthood. It also does grave harm to people with disabilities who rely on Medicaid for critical services that allow them to live in the community instead of an institution." said ACLU natonal political director, Faiz Shakir.

Democratic Representative Earl Blumenauer tweeted after the vote: "Republicans should be ashamed. America will hold them responsible."

Once the vote count reached the 216 mark it needed to pass, Republicans in the chamber cheered. In response, Democrats started to sing "Hey, hey, goodbye" - something Republicans did in 1993 at the passing of a tax bill.

In a look forward to the issues the bill will face when it reached the Senate, Democratic Senator Sheldon Whitehouse said: "This legislation sets us on a path to the bad old days when insurance companies could refuse coverage to those with preexisting conditions and deny people health benefits that should be in every plan – like ‎maternity and mental health care."

Republican Senator Lindsey Graham adopted a more reserved tone in his statement, saying that he would be "carefully reviewing" the bill.

The passage is seen as a victory for President Donald Trump, who promised consistently on the campaign trail that he would repeal Obamacare.