DALLAS (AP) — Charlie Wilson, the Texas congressman whose backroom dealmaking funneled millions of dollars in weapons to Afghanistan, allowing the country's underdog mujahedeen rebels to beat back the mighty Soviet Red Army, died Wednesday. He was 76.

Wilson died at Memorial Medical Center-Lufkin after having difficulty breathing after attending a meeting in the eastern Texas town where he lived, said hospital spokeswoman Yana Ogletree. Wilson was pronounced dead on arrival, and the preliminary cause of death was cardiopulmonary arrest, she said.

Wilson represented Texas' 2nd Congressional District in the U.S. House from 1973 to 1996 and was known in Washington as "Good Time Charlie" for his reputation as a hard-drinking womanizer. He once called former congresswoman Pat Schroeder "Babycakes," and tried to take a beauty queen with him on a government trip to Afghanistan.

Wilson, a Democrat, was considered both a progressive and a defense hawk. While his efforts to arm the mujahedeen in the 1980s were a success — spurring a victory that helped speed the downfall of the Soviet Union — he was unable to keep the money flowing after the Soviets left. Afghanistan plunged into chaos, creating an opening eventually filled by the Taliban, which harbored al-Qaida terrorists.

After the Sept. 11, 2001 terror attacks — carried out by al-Qaida terrorists trained in Afghanistan — the U.S. ended up invading the country it had once helped liberate.

"People like me didn't fulfill our responsibilities once the war was over," Wilson said in a September 2001 interview with The Associated Press. "We allowed this vacuum to occur in Afghanistan and Pakistan, which enraged a lot of people. That was as much my fault as it was a lot of others."

His efforts to help the Afghan rebels — as well as his partying ways — were portrayed in the movie and book "Charlie Wilson's War." In an interview with The Associated Press after the book was published in 2003, he said he wasn't worried about details of his wild side being portrayed.

"I would remind you that I was not married at the time. I'm in a different place than I was in at the time and I don't apologize about that," Wilson said.

U.S. Defense Secretary Robert Gates said that when he was at the CIA he knew Wilson, whom Gates said "was working tirelessly on behalf of the Afghan resistance fighting the Soviets."

"As the world now knows, his efforts and exploits helped repel an invader, liberate a people, and bring the Cold War to a close. After the Soviets left, Charlie kept fighting for the Afghan people and warned against abandoning that traumatized country to its fate — a warning we should have heeded then, and should remember today," Gates said in a written statement.

Charles Nesbitt Wilson was born June 1, 1933, in Trinity. He attended Sam Houston State University in Huntsville before earning his bachelor's degree from the U.S. Naval Academy in 1956.

Wilson served as a Naval lieutenant between 1956-60, then entered politics by volunteering for John F. Kennedy's presidential campaign. He served in the Texas House and then in the Texas Senate before being elected to the U.S. House in 1972.

As a member of the House Appropriations Committee, Wilson helped secure money for weapons and worked with then-CIA agents Gust L. Avrakotos and Mike Vickers to get them to the mujahedeen. The Soviets spent a decade battling the rebels before pulling the Red Army from Afghanistan in 1989. Two years later, its economy in ruins, the Soviet Union fell apart.

Vickers, now assistant secretary of defense for special operations, said Wednesday that Wilson was a "great American patriot who played a pivotal role in a world-changing event — the defeat of the Red Army in Afghanistan, which led to the collapse of communism and the Soviet empire."

Longtime friend Buddy Temple, who was with Wilson when he collapsed Wednesday, said that despite Wilson's reputation as a playboy, he was serious about representing east Texas, including helping to create the Big Thicket National Preserve — almost 100,000 acres (40,470 hectares) of swamps, bogs and forests.

"Charlie was a giant. We have lost a giant. There won't be another like him," Temple said at a hospital news conference announcing Wilson's death.

Wilson left politics in 1996, after he no longer found it any fun. He lobbied for a number of years before returning to Texas. In 2007, he had a heart transplant after being diagnosed with cardiomyopathy, a disease that causes an enlarged and weakened heart.

Schnabel said he had just been with Wilson a few weeks ago for the dedication of the Charlie Wilson chair for Pakistan studies at the University of Texas, Austin, a $1 million endowment. He said Wilson had been doing "very good" and said his former boss described himself as "a poster boy" for heart transplants.

Ogletree said Wilson is survived by his wife, Barbara, whom he married in 1999, and a sister.