US President Barack Obama has ordered almost all hospitals to give gay partners equal rights in visiting and making decisions for their loved ones.

He has instructed his Health and Human Services secretary to draft rules requiring all hospitals which receive Medicare and Medicaid payments to give patients to the right to choose who can visit them and make decisions for them if they are unable to.

This means that gay couples can be treated in the same way as a husband and wife at such hospitals.

Mr Obama said in a White House statement: “Every day, all across America, patients are denied the kindnesses and caring of a loved one at their sides – whether in a sudden medical emergency or a prolonged hospital stay. Often, a widow or widower with no children is denied the support and comfort of a good friend.”

He added: “Also uniquely affected are gay and lesbian Americans who are often barred from the bedsides of the partners with whom they may have spent decades of their lives – unable to be there for the person they love, and unable to act as a legal surrogate if their partner is incapacitated.”

In 2007, Florida resident Janice Langbehn was barred from seeing her partner of 17 years as she lay dying in hospital of a brain aneurysm.

The couple had three adopted children and were on holiday when Lisa Pond became ill. They were kept apart despite Ms Pond having a health directive which named her partner.

Ms Langbehn sued Jackson Memorial Hospital in Miami but a court threw out the case.

Joe Solmonese, president of Human Rights Campaign, said: “Discrimination touches every facet of the lives of lesbian, gay, bisexual and transgender people, including at times of crisis and illness, when we need our loved ones with us more than ever.

“No one should experience what befell the Pond-Langbehn family, and the president’s action today will help ensure that the indignities Janice and her children faced do not happen to another family.”