TALLAHASSEE — Former US Representative Clay Shaw, a longtime veteran of Congress who helped President Clinton achieve his goal of ending ‘‘welfare as we know it,’’ has died after a lengthy battle with lung cancer.

Representative Shaw’s family said he died Tuesday night at Holy Cross Hospital in Fort Lauderdale. He was 74.

Representative Shaw spent 26 years in Washington and was among the first in a line of Republicans who helped transform Florida from a state dominated by one political party into the battleground state that it is today.

He held positions in the city of Fort Lauderdale, including mayor, before riding into office with President Reagan in 1980. He survived several spirited challenges to his South Florida seat only to finally lose his spot during a Democratic wave in 2006.

‘‘Clay cherished his time in the US Congress representing the people of South Florida,’’ said his wife Emilie Shaw. ‘‘He was a devoted family man setting a fine example for our 15 grandchildren. They will always be proud of Clay’s love of country.’’

One of Representative Shaw’s standout moments was his role in sponsoring and helping shepherd in 1996 a contentious bill to revamp the nation’s safety net known as welfare. The measure put in place time and work requirements on welfare beneficiaries and gave states a much greater say in running the program.

Representative Shaw had worked on previous efforts to change the program, but that legislation had stalled before Republicans won control of Congress in 1994. Clinton, however, twice vetoed welfare overhaul bills, prompting Representative Shaw to complain at one point that the Democratic president had ‘‘caved in to the liberal wing of his party.’’

Clinton, who was running for reelection at the time, finally signed a third overhaul into law in August 1996 despite criticism from some Democrats that the measure would hurt the nation’s poor.

Representative Shaw, right before the bill was passed, said that the ‘‘the degree of success that we are going to have is going to be a victory for the American people, for the poor.’’

‘‘He spent a long career in Congress trying to accomplish, without partisanship or rancor, what was best for the people in his congressional district,’’ said former US senator George LeMieux, a Republican who once interned for Representative Shaw.

US Senator Marco Rubio said in a statement that he was ‘‘impressed with Clay’s work on the causes he was most passionate about.’’

Eric Eikenberg, who served as Representative Shaw’s chief of staff for nearly four years, called Representative Shaw a ‘‘true gentleman’’ and wonderful boss. He recalled that while serving as Representative Shaw’s campaign manager in 2000 that he had failed to properly file some election paperwork, which meant Representative Shaw had to pay a fee in order to qualify for reelection.

Instead of yelling at him, Eikenberg recalled that he said: ‘‘It’s not going to be your last mistake.’’

‘‘He was more interested in accomplishing legislative objectives than worrying about what cable television interview he was going to be on,’’ Eikenberg said.

During his lengthy career in Congress, Representative Shaw also led an effort to eliminate Social Security earning penalties for working seniors, and he also pushed through federal legislation to help restore the Everglades.