With the April 26 Pennsylvania primary near, Donald Trump has picked up the endorsement of a congressman who bears the battle scars of his own war on illegal immigration - one he lost, but does not regret.

Rep. Lou Barletta, 56, has represented the 11th District, a swath of counties in the state's conservative center, for five years. But in 2006, he was the Republican mayor of Hazleton, a man both demonized and lionized for trying to bar the city's door against what he saw as an invasion of undocumented Latinos.

"It was uncharted territory for a city to try to do something about the problem of illegal immigration," he said in a recent interview. "Fast-forwarding to today, we were a bit ahead of our time."

Grandson of an Italian immigrant, Barletta ran a prosperous business painting lines on roads until he won his first mayoral election in 1999. He became convinced that "illegal aliens" were bringing crime to his hometown, overburdening its schools and public safety services, and clogging area emergency rooms, he recalled.

His tipping point came in spring 2006, during the second of his three terms, when city resident Derek Kichline, a 29-year-old father of three, was murdered. The two suspects were in the United States illegally.

Turning to the Internet, Barletta found a relevant ordinance from San Bernardino, Calif., crafted but never voted on, and "tweaked it," he said. Under his proposed law, landlords who rented to undocumented immigrants would be fined $1,000 per day and employers who hired them would lose their business licenses for five years. English would be Hazleton's "official language."

With Barletta present in a bulletproof vest, City Council passed the Illegal Immigration Relief Act, 4-1. But it never went into effect.

Federal courts ruled it unconstitutional, and the case ultimately was rebuffed by the U.S. Supreme Court. Hazleton was ordered to pay nearly $1.4 million in fees to the civil rights lawyers who fought the act. And as for the suspects in Kichline's murder, all charges were dropped, although one of the pair was deported and the other served time for an unrelated stabbing.

Hardly the outcome Barletta wanted. If he had it to do over?

The problem of illegal immigration "was created because the federal government didn't do its job - and still isn't doing its job," he said. "I was a mayor who said, 'I am going to try to do something.' Do I regret that? No."

His actions, he said, encouraged dozens of other municipalities to enact or attempt to enact local laws that target undocumented immigrants, that separate "the salt from the sugar."

His own political fortunes didn't seem to suffer. He is in his second term in Congress, and is running for reelection this year.

Barletta backed Rick Santorum in the 2016 GOP presidential race, until the former senator dropped out in early February.

Even before endorsing Trump, he opposed mainstream Republican efforts to derail his candidacy.

Trump is "talking to people, and hearing their frustration - the same frustration I had 10 years ago . . . born of the fact that the federal government refuses to enforce our laws and has not secured our borders," he said.

"We should be looking at why so many people support Donald Trump. Why is he winning? . . . There's a reason this is happening."