CHICAGO – Former U.S. Rep. Dan Rostenkowski, the Chicago Democrat who became the leading architect of congressional tax policy in the Reagan era but later went to federal prison for corruption, died Wednesday, a family friend said. He was 82.

Rostenkowski, who served 18 terms before losing in 1994, died surrounded by family at his home in Lake Benedict, Wis., friend Ellen Tully told The Associated Press. He died of lung cancer, which was diagnosed last August, Tully said.

As House Ways and Means Committee chairman, Rostenkowski was known as a consensus builder and a master of legislative tactics. He is credited with leading a 1983 effort to rescue Social Security from insolvency and pushing through a sweeping 1986 overhaul of the nation’s tax system.

Friends and colleagues said that despite the corruption scandal — Rostenkowski pleaded guilty to using office funds for his own use for gifts such as Lenox china and armchairs — he will be best remembered as a master politician who got things done.

In 2000, then-President Bill Clinton pardoned Rostenkowski.