Wecht conceded that Carrasquillo's request, made just minutes before he was sentenced by Common Pleas Court Judge Ramy I. Djerassi, was couched in bizarre and seemingly irrational language.
Nevertheless, he said, Carrasquillo asserted a "fair and just reason" to withdraw his guilty plea: a claim that he was innocent.
In the minority opinion, Judge Sallie Mundy wrote that Carrasquillo conditioned his withdrawal of a guilty plea on undergoing a lie-detector test. The court's precedent holds that such conditions are "not a fair and just reason" for withdrawing a guilty plea, he said.
The District Attorney's Office released a statement saying, "We are disappointed with the court's decision and while we haven't decided yet what our next step will be, there is no question that Carrasquillo is the person responsible for the brutal attack of an innocent 11-year-old girl."
Karl Baker, one of three lawyers for the Defender Association who worked on the Carrasquillo appeal, said that "this is not an unusual ruling. Our courts have traditionally reaffirmed" a defendant's right to withdraw a guilty plea before sentencing.
Carrasquillo, 30, is in the Somerset state prison in southwestern Pennsylvania.
He pleaded guilty to the June 2009 rape of the 11-year-old and the attempted assault of a 16-year-old girl who escaped and whom Carrasquillo pursued into the cafeteria of Kensington High School before being scared off.
His case gained national notoriety the following day when a vigilante crowd in Kensington cornered him on the street and beat him after police released his name and photo as a "person of interest" in the rape. The crowd held Carrasquillo until police arrived, and he spent several days recovering in the hospital.
Carrasquillo's Nov. 30, 2011, sentencing, three months after he pleaded guilty, was also notable.
Carrasquillo insisted he was innocent. He also said he was the Antichrist, a revelation he said came to him in prison in 2002, and he said the CIA tried to cover that up. And then there were the immigration agents who wanted to send him to China "to assassinate the president."
He could prove it all, Carrasquillo said, if only the prosecutors would give him a lie-detector test.
He never got that test. Instead, he got a long prison term. Djerassi denied the request to withdraw the guilty plea, saying Carrasquillo was "not acting in good faith" and he did not believe Carrasquillo had lost touch with reality.
In court filings, prosecutors maintained that Carrasquillo's behavior at sentencing was "gamesmanship" designed to manipulate the victim and the justice system. Prosecutors said they would be prejudiced in taking the case to trial because, after Carrasquillo's guilty plea, they had told the girl she would never have to testify.
In addition to the victim's testimony and Carrasquillo's confession to police, there was DNA and fingerprint evidence linking him to the rape, prosecutors said.