US Senator Lindsey Graham, a key Republican who went from a vocal critic of Donald Trump to one of his most loyal allies on Capitol Hill, has died at age 71.

Mr Graham’s office posted that the South Carolina lawmaker died after a “brief and sudden illness” on X early on Sunday.

Emergency personnel had responded to a call for cardiac arrest at his Capitol Hill home on Saturday night, according to US media.

Mr Graham, just back from a trip to Ukraine, had been scheduled to appear on the “Meet the Press” interview program on Sunday morning, the network said.

Early on in his career, Mr Graham was a vocal critic of Trump.

“He doesn’t represent my party. He doesn’t represent the values that the men and women who wear the uniform are fighting for,” Mr Graham said on CNN.

He later became one of Trump’s staunchest ally.

Shortly after his death was announced, Trump called Mr Graham “one of the greatest people and senators I have ever known” and a hard-working patriot.

Mr Graham’s website wrote that the defence hawk “consistently pushed for outcomes in the War on Terror that protect our long-term national security interests”.

He was a prominent supporter of Israel and Ukraine and an opponent of Iran.

Israeli Prime Minister Benjamin Netanyahu said in a statement that “Israel has lost one of its greatest friends. America has lost a great patriot. I have lost a beloved friend”.

Mr Graham recently served as chairman of the Senate Budget Committee and was a member of the Committee on Appropriations, the Judiciary Committee and the Committee on Environment and Public Works.

A former Air Force lawyer and member of the South Carolina Air National Guard, Mr Graham was elected to the Senate in 2002. Before that, he was elected to the House of Representatives in 1994 for South Carolina’s 3rd congressional district, according to his website.

He was not married and lived in Seneca, South Carolina.

-With Reuters