HARRISBURG - Pennsylvania's presidential electors on Monday unanimously cast their 20 votes for Donald Trump, helping the Republican president-elect cross the Electoral College threshold to become the country's 45th commander-in-chief next month.

The early-afternoon ceremony of scripted formalities took a little more than an hour inside the state House chamber and ended with applause from Republicans on the floor. But the traditionally staid ceremony also drew a bigger spotlight and protesters. When the tally was announced, cries of "Shame on you" erupted from the gallery.

Similar votes occurred all day long in state capitals nationwide, dashing hopes of Trump critics and Hillary Clinton supporters that a last-minute defection of electors would deny him the victory. By early evening, he had secured more than the 270 votes he needed.

For Pennsylvania Republicans, the day marked the first time since 1988 that their electors had represented the Keystone State.

"It's a very jubilant atmosphere for the Republican Party of Pennsylvania," elector Richard Stewart of Cumberland County said after the vote. "It's been a long time since we've taken the state for our candidate, and we're very proud to have put Donald Trump and Mike Pence over the top."

State Republican Party Chairman Rob Gleason, who was elected president of the Electoral College meeting, acknowledged that the 2016 election was "unconventional and fiercely competitive."

But in a speech on the House floor, Gleason said Trump and Pence would be president and vice president of all Americans.

"I know that Donald Trump and Mike Pence will be working to make America great again for everyone, and it will be up to each and every one of us to help them shape the future of our country," he said.

The demonstrators began arriving Sunday, and by Monday morning, several hundred filled the Capitol steps and grounds. Police arrested one Trump protester for disorderly conduct, according to a spokesman for the Department of General Services.

Inside the building, the electors answered a roll call, took an oath of office and elected officers to preside over the vote. Then Gov. Wolf addressed them, acknowledging that they would follow the direction of the voters.

"Today you will officially select the next president of the United States," the Democratic governor told them. "You will follow the will of the people of Pennsylvania."

Then the 20 wrote their choice for president on ballots. As they did, a person shouted, "Vote your conscience!"

In interviews last week, several electors said there was no chance any in Pennsylvania would not vote for Trump.

That did not stop Kate Galvin and Krista Apple from traveling to the Capitol to voice their hope that an elector could at the last minute have a change of mind.

"I felt like as a citizen who cares about this country, I needed to do everything in my power to try and stop Trump from becoming our president," said Galvin, a theater director and producer from Philadelphia. "I think he's really dangerous, and I think he's really uninformed and also not interested in being informed. I have close friends who are high up in government, and they are scared."

Donna Kolaetis, a Quaker from Adams County, was among those who gathered in the Capitol rotunda to urge the electors to reconsider casting their votes for Trump.

She said there had been times in the past that she was unhappy about the choice for president.

"But I've never felt that our system of government - our democracy - is at risk," she said. "I think war, and perhaps nuclear war, is a real possibility with someone who tweets what he thinks and seems to have very poor impulse control. . . . He's not a stabilizing force."