Senator Robert Byrd, the longest-serving member ever of the US Congress, has died at the age of 92, a spokesman said today.

The Democratic senator from West Virgina, who was a member of the Ku Klux Klan before becoming a civil rights advocate, died peacefully at Inova Fairfax hospital outside Washington, Jesse Jacobs said.

Byrd was an influential politician under a dozen presidents and his death, which follows that of Edward Kennedy in August, means the Senate has lost two of its most illustrious figures.

"I love to serve. I love the Senate. If I could live another 100 years, I'd like to continue in the Senate," Byrd said in a 2006 interview with Reuters.

In a notable moment of his career, Byrd spoke eloquently against the Iraq war, when so many of his colleagues were cowed into submission by the Bush administration. He also warned against a build-up of US troops in Afghanistan.

Byrd's death is not expected to change the Democrats' majority in the Senate. The West Virginia governor, Joe Manchin, a Democrat, is expected to appoint a Democrat to serve the remainder of Byrd's six-year term, which expires in 2012.

Byrd was first elected to the House of Representatives in 1952, serving six years there before moving to the Senate. In his early campaigns the self-described "hillbilly" used his musical skills as a bluegrass fiddler to help draw big and enthusiastic crowds.

His politics shifted considerably over the years, as he moved away from his hard-right origins.

"When I got here, I was to the right of Barry Goldwater," Byrd told Reuters, referring to a conservative Republican senator and failed 1964 presidential candidate. "I moved more to the centre."

In the early 1940s, before being elected to Congress, Byrd belonged to the Ku Klux Klan, a membership that he attributed to youthful indiscretion.

"It has emerged throughout my life to haunt and embarrass me and has taught me in a very graphic way what one major mistake can do to one's life, career and reputation," Byrd wrote in a 1987 memoir, Robert C Byrd: Child of the Appalachian Coalfields.

In Congress, Byrd denounced the civil rights leader Martin Luther King as a "self-seeking rabble rouser", before turning into a leading backer of civil rights.

Of the record-setting 18,500-plus Senate votes Byrd cast, he said his biggest regret was opposing the 1964 Civil Rights Act, a landmark law that brought down barriers for black Americans.

He said his views changed most dramatically after his teenage grandson was killed in a 1982 traffic accident. "The death of my grandson caused me to stop and think," Byrd said. "I came to realise that black people love their children as much as I do mine."

Byrd was born Cornelius Calvin Sale Jr on 20 November 20 1917 in North Carolina and was sent to live with relatives in West Virginia after his mother died in the 1918 flu pandemic. His new family renamed him and Byrd grew up desperately poor in the West Virginia coal fields. Unable to afford college, he worked as a meat cutter during the Great Depression and as a welder building ships during the second world war. Byrd married his high school sweetheart, Erma Ora James, in 1936. They had two daughters and six grandchildren.

"For two hillbillies – that is what we are, two hillbillies – from West Virginia, it has been an exciting and wild ride," Byrd said in a Senate speech marking their 65th anniversary. She died in March 2006.

Byrd set the record for congressional longevity last November, eclipsing the mark held by the late Carl Hayden.

On that day, Byrd said: "My only regret is that my beloved wife, companion and confidante, my dear Erma, is not here with me. I know that she is looking down from the heavens smiling at me and saying, 'Congratulations my dear Robert – but don't let it go to your head.'"