President Obama signed a memorandum late Thursday ordering the Department of Health and Human Services to establish new rules that would prevent hospitals from denying visitation rights to the partners of gay men and lesbians.

The White House also wants to make it easier for a gay partner to make medical decisions.

The new rules will affect any hospital that participates in Medicare or Medicaid, which includes the majority of U.S. hospitals.

“There are few moments in our lives that call for greater compassion and companionship than when a loved one is admitted to the hospital,” Obama said in the memorandum. Gay men and lesbians are “uniquely affected” because they are “often barred from the bedsides of the partners with whom they may have spent decades of their lives,” he added.

Obama said the order, which would allow a patient to designate a non-familial visitor with decision making and visiting privileges no more restrictive than those of immediate family members, could also help a widow or widower with no children and members of religious orders.

The order also prohibits hospitals from denying visitation privileges on the basis of a variety of characteristics, including sexual orientation and gender identity.

Gay rights groups welcomed the president's actions.

“In the absence of gay people being able to legally marry in most jurisdictions, this is a step to rectify a gross inequity,” David Smith, an executive at the Human Rights Campaign (HRC), the nation's largest gay rights advocate, told CNN. “Because without gay marriage, much more inequities exist. It should be applauded.”

Smith said HRC had worked closely with the Obama administration in tailoring the memorandum's language.

The president's memo also asks the health secretary to provide additional health care recommendations on issues that “affect LGBT patients and their families” within the next 180 days.

“By taking these steps, we can better protect the interests and needs of patients that are gay or lesbian, widows and widowers with no children, members of religious orders, or others for whom their loved ones are not always immediate relatives,” Shin Inouye, a White House spokesman, told the New York Times. “Because all Americans should be able to have loved ones there for them in their time of need.”