Gov. Tom Corbett of Pennsylvania said Wednesday that he would not appeal a judge’s ruling striking down Pennsylvania’s ban on same-sex marriage.

With the decision, Pennsylvania became the 19th state, along with the District of Columbia, where same-sex couples are able to marry. Judge John E. Jones III of Federal District Court on Tuesday became the latest judge to throw out a series of state bans around the country, writing, “It is time to discard them into the ash heap of history.”

Mr. Corbett, a Republican facing a difficult re-election this year, announced his decision the day after Democratic primary voters picked Tom Wolf, a wealthy businessman, to challenge him. Polls show a majority of Pennsylvanians favor legalizing same-sex marriage. Had the governor appealed the court’s decision, he risked handing his opponent a potent issue on which to drive Democrats to vote.

After reviewing Tuesday’s opinion, Mr. Corbett, a former attorney general, said in a statement, “Given the high legal threshold set forth by Judge Jones in this case, the case is extremely unlikely to succeed on appeal.” He added: “As a Roman Catholic, the traditional teaching of my faith has not wavered. I continue to maintain the belief that marriage is between one man and one woman.”