A former Republican political operative convicted in the first federal criminal case of illegal coordination between a campaign and a purportedly independent ally was sentenced Friday to two years in prison — a lighter punishment than prosecutors sought but one that still served as a sharp warning.

Under questioning from U.S. District Judge Liam O’Grady, Tyler Harber said: “I’m guilty of this. I knew it was wrong when I did it.” But Harber said he was not motivated by greed or a lust for power — he simply wanted to win an election and believed that what he was doing was a common, if illegal, practice.

“I got caught up in what politics has become,” said Harber, 34, a resident of Alexandria.

Harber, who managed the unsuccessful 2012 congressional campaign of Chris Perkins in Northern Virginia — admitted in February that he helped create a super PAC and arranged for it to buy $325,000 in ads to help Perkins’s campaign, then lied to the FBI about his misdeeds. Federal prosecutors hailed Harber’s guilty plea and sentence as “an important step forward in the criminal enforcement of federal campaign finance laws,” and they indicated that they are ramping up scrutiny of the close ties between political campaigns and their ostensibly independent supporters.

The watershed prosecution comes as super PACs are playing increasingly prominent roles in national politics. Nearly all the 2016 White House contenders are being helped by outside groups run by friends or former strategists — in many cases, operating in close proximity. But complaints about potentially illegal coordination have stalled before the Federal Election Commission, which is mired in partisan gridlock.

Top federal officials issued strong statements Friday warning that candidates and consultants should tread carefully as the 2016 race heats up.

Assistant Attorney General Leslie R. Caldwell said that political operatives should “think twice about circumventing laws that promote transparency in federal elections” and encouraged party and campaign insiders to act as whistleblowers. In court, federal prosecutor Richard Pilger asked O’Grady to send Harber to prison for three years and 10 months, saying such a term would send a message to the campaign world that “how you win matters.”

Harber’s defense attorneys argued that a sentence of a year and eight months was more appropriate. They asserted that Harber, a married father of two, was already financially ruined and unlikely to ever again work in the field where he was once a rising star.

“The whole thing is foolish, given the consequences to himself,” defense attorney Shannon Quill said.

Although the sentence was closer to defense attorneys’ request than prosecutors’, leading election-law attorneys said the aggressive stance by the Department of Justice should put donors and political consultants alike on guard.

“I think the department is trying to deliver a very clear message that it affirmatively wants to bring criminal-coordination cases and it is simply looking for the right opportunities to do so,” said Robert Kelner, who heads the political law practice at Covington & Burling.

Kenneth Gross, a former associate general counsel at the FEC, called the department’s posture “a shot across the bow.”

“This shows they are willing to venture into areas of criminal enforcement in the 2016 election, beyond what they had done previously,” Gross said.

In court, O’Grady peppered all those involved with critical inquiries. He asked Pilger detailed questions about the money involved in the scheme. He told Harber that he did not understand what could have possibly motivated his crime, and he wondered aloud why the operative did not simply have someone else take over the super PAC.

For his part, Harber repeatedly took responsibility for his actions, although he asserted that he was motivated, in part, by watching others do the same things and get away with them.

He said he started the super PAC — which he did not identify, although federal records indicate it was likely the National Republican Victory Fund — as a legitimate operation, then began using it nefariously to help Perkins’s campaign.

“It wasn’t for greed. It wasn’t for power,” Harber said. “It was money in an attempt to win a race.”

Perkins ultimately lost by a sizeable margin to Democratic incumbent Gerald E. Connolly to represent Virginia’s 11th District.

In addition to admitting illegal coordination, Harber conceded that his super PAC — which was donor-funded — paid $138,000 to his mother’s company for work that was never performed and used $118,000 of that cash for personal expenses.

Harber’s sentencing comes as watchdog groups are appealing to the Justice Department to investigate such cases. Last month, Democracy 21 and the Campaign Legal Center called on the department to look into ties between former Florida governor Jeb Bush and his associated super PAC.

But campaign finance lawyers noted that the facts in Harber’s case were unusually clear-cut, involving a scheme to enrich himself and then lying to the FBI.

“It’s an extreme case,” said Anthony Herman, a former FEC general counsel. “I think it’s quite possible that this may be unique, or one of a few we will see.”

Still, Cleta Mitchell, a top Republican election-law attorney, said that Harber’s prosecution challenges the notion that there is no enforcement of campaign finance rules.

“It may take a while, and I wish the FEC could figure out a way to move things faster,” she said. “But the law is still there, and anybody who thinks it isn’t proceeds at their own peril.”

All those involved in Harber’s case seemed keenly aware of the political climate. Prosecutors argued that a significant punishment was necessary — in part because of the surge in outside groups’ spending since the Supreme Court’s 2010 Citizens United decision, which allowed corporations and unions to spend unlimited amounts independently on political activity. Quill referenced news reports about candidates delaying the announcement of their campaigns “so they don’t fall under these rules.”

O’Grady commented that he hoped conduct like Harber’s was “not as rampant” as the former operative seemed to believe.

After the hearing, Harber declined to comment. He left the courtroom with his family and will report to prison at a later date.