Pennsylvania Election Results Live: Latest updates in the Clinton vs. Trump race

Republican nominee Donald Trump has taken Pennsylvania and its coveted 20 Electoral College votes.

On Tuesday, voters in Pennsylvania went to the polls to cast their votes for president. Political analysts were watching Pennsylvania closely — the state, a key battleground state, has voted for the Democratic nominee in the past four elections.

The state's approximately 12.8 million residents are an important part of the path to the White House, and both candidates have campaigned heavily there in the weeks leading up to Election Day.

Hillary Clinton had led Trump just slightly in Pennsylvania. On Monday, the day before the election, RealClearPolitics gave Clinton a 2.1-point lead over Trump in an average of polls. A month ago, Clinton led by 10 percentage points in Pennsylvania, according to a Monmouth University poll. 

Trump was in Scranton, Pennsylvania, on the eve of the election, appealing to miners and steel and factory workers. "Everybody is thirsting for change," he said.

Clinton also made a last sweep through the state on Monday and brought along several high-level surrogates, including President Barack Obama, first lady Michelle Obama, former President Bill Clinton and Clinton's daughter Chelsea.

Pennsylvania does not have early voting

Nov. 9, 2016, 1:39 a.m. Eastern: This story has been updated.