HARRISBURG - In the end, Attorney General Tom Corbett not only got his man, he got him sentenced Friday to at least 21 months in prison.

But even after Brett Cott was led away in handcuffs, controversy lingered over whether Corbett went too far by using a grand-jury subpoena to try to learn if he was the anonymous writer who used Twitter and the Internet to deride Corbett, his prosecutors, and their witnesses.

Cott, the former legislative aide convicted in the so-called Bonusgate scandal for conspiring to use state funds and staffers for political campaigning, was sentenced Friday to 21 to 60 months in prison. Dauphin County Court Judge Richard A. Lewis said Cott's crimes were "an incalculable blow" to the electoral process.

With that, prosecutors said they had withdrawn the subpoena sent this month to Twitter Inc. in San Francisco, seeking clues to the identities of two Twitter users, one of whom they suspect is Cott.

Corbett's office said that Cott's sentencing made the subpoena unnecessary and that in any event, Twitter was refusing to give up the data.

That didn't satisfy the state American Civil Liberties Union, which is representing the two anonymous Twitter users. "While we are pleased that the Pennsylvania Attorney General's Office has withdrawn the subpoena to Twitter for identity information on our clients . . . the ACLU maintains grave concerns about the A.G.'s handling of this affair," said Witold Walczak, legal director for the local chapter.

In court Friday, a prosecutor argued that Cott's lack of contrition for his offenses revealed his true character and should factor into his sentence.

"He is arrogant, he has contempt for the process, and he has contempt for the court," Senior Deputy Attorney General Patrick Blessington said at the sentencing hearing. "He refuses to acknowledge remorse."

But Lewis did not mention lack of remorse when he explained his reasons for jailing Cott for up to five years.

Prosecutors said the subpoena was based on "legal reasons" on which they could not elaborate given the secret nature of grand jury proceedings. And they reiterated it had nothing to do with silencing online critics.

Even so, the subpoena has brought Republican gubernatorial nominee Corbett a barrage of criticism - not only from Democratic rival Dan Onorato, but from First Amendment and electronic-privacy advocates, who contend such a move amounts to trying to silence and intimidate people who don't agree with Corbett.

Some lawyers said using the grand-jury process to seek information for use in sentencing was an abuse of the system.

"The grand jury is supposed to investigate crime, and instead it is being used to gather evidence," said David Laigaie, a lawyer who has represented The Inquirer and other media in First Amendment cases. "If you are convicted, you lose your right to vote. You don't lose your First Amendment rights."

Marc Rotenberg, executive director of the Washington-based Electronic Privacy Information Center, called the subpoena "unbelievable." He said using such a tool to find information for a sentencing argument was "outside the realm" of sentencing guidelines.

After Cott's sentencing hearing, Senior Deputy Attorney General E. Marc Costanzo said that in the age of Twitter and blogs, anyone can post anything - including lies - about a prosecutor, a witness, or testimony.

Costanzo appeared to suggest that prosecutors suspected that someone was using Twitter to try to influence jurors and others during Cott's trial this year.

"What kind of chilling effect is that going to have on future witnesses?" asked Costanzo. "What kind of chilling effect will it have on prosecutors? What kind of chilling effect will it have on a judge? What kind of chilling effect will it have on jurors . . . where there are obvious messages being sent to [jurors] during deliberations: 'Don't do this, don't do that, and I think you should decide this way.' "

"This whole realm of the law is going to have to be something that gets ultimately addressed by our courts and our legislature," he added.

In sentencing Cott, Lewis said the former House aide's conduct had transcended even "the blurriest of lines."

Cott was among three Democrats found guilty in March of using taxpayer money and resources for political campaigns. The other two defendants, former Rep. Mike Veon (D., Beaver) and his longtime aide Annamarie Perretta-Rosepink, are to be sentenced next month.

Cott's attorney, Bryan Walk, said Cott would appeal his conviction and sentence, which he called a disappointment.

"The Attorney General's Office should be ashamed of themselves for asking for a sentence like this," said Walk. "We've got drug dealers that the Attorney General's Office prosecutes who don't get that much time."