A United States governor has been urged to resign over a racist photo in which he appeared more than 30 years ago.

Virginia governor Ralph Northam appears to have almost no choice but to leave office after losing support from virtually the entire state Democratic party and other key allies.

The calls for Mr Northam to step down came in a wave after the Democrat had apologised for appearing in a photo in which one person is dressed in blackface and another is wearing a full Ku Klux Klan uniform.

The photo appeared in his 1984 medical school yearbook.

The yearbook images were first published on Friday by the conservative news outlet Big League Politics.

The Virginian-Pilot later obtained a copy from Eastern Virginia Medical School, which Mr Northam attended.

The photo shows two people looking at the camera — one in blackface wearing a hat, bow tie and plaid trousers; the other in a full Ku Klux Klan robe.

In his first apology, issued in a written statement, Mr Northam called the costume he wore “clearly racist and offensive”, but he did not say which one he had worn.

He later issued a video statement saying he was “deeply sorry” but was still committed to serving the “remainder of my term”.

“I accept responsibility for my past actions and I am ready to do the hard work of regaining your trust,” Mr Northam said.

But Mr Northam appears to have virtually no path forward to remain in office without any institutional support.

US House Speaker Nancy Pelosi called the photograph “racist and contrary to fundamental American values”.

She said on Saturday via Twitter that she is joining her colleagues in Virginia in calling for Mr Northam “to do the right thing” so that the people in Virginia can heal and move on.