President Trump's visit to a Shell natural gas plant in rural western Pennsylvania on Tuesday was an official White House event, but that might not have been readily apparent to those listening to his speech.

Addressing workers at the yet-to-be-completed plant in Monaca, Pennsylvania, Mr. Trump reminisced about the margins of his 2016 victory in the county, predicted the states he would win again, touted his administration's immigration policies, attacked the "fake news" media and blasted his political foes. The president even explicitly urged workers, hundreds of whom were gathered for his speech, to vote for him.

"In 2020, we're running, so you'd better get out there and make sure we win," the president said in his speech, which ran more than an hour and was supposed to focus on American energy dominance and manufacturing.

Get updates from the campaign trail delivered to your inbox

The line between the president's political events and official events are often blurred as the presidential election nears and Mr. Trump, who filed for reelection the day he was sworn into office, travels to states that are key to his victory. Pennsylvania, Mr. Trump's campaign officials and political analysts recognize, is pivotal to his successful reelection — Tuesday marked his 13th visit to the state since taking office.

President Trump speaks to contractors at the Shell Chemicals Petrochemical Complex on August 13, 2019, in Monaca, Pennsylvania. Getty

At the event, the president bashed his predecessors and faulted former vice president Joe Biden, his potential Democratic rival, for the nation's struggles. He also took one of his typical swipes at Elizabeth Warren, or "Pocahontas," as the president calls the Massachusetts senator who once claimed native American heritage. Biden and Warren are among the top contenders in the polls.

"We'll have to hit Pocahontas again if she does win," Mr. Trump told the Pennsylvania crowd, adding soon thereafter, "What a group, Pocahontas and Sleepy Joe."

The president insisted he's a big supporter of unions, and said he wants union members to be sure to tell their leaders, "I hope you're going to support Trump."

"And if they don't, vote them the hell out of office," said the president, who also managed to slip in "Make America Great Again" and "Keep America Great" lines in his 67-minute speech.

He also joked about serving more than two terms.

"Can you imagine if I got a fair press? I mean, we're leading without it," the president said. "Can you imagine if these people treated me fairly? The election would be over. Have they ever called off an election before? Just said, 'Look, let's go, four more years.' Yeah. And then you want to really drive them crazy, go to 'hashtag, third term, hashtag, fourth term,' you'll drive them totally crazy."

Mr. Trump did spend significant chunks of his speech touting his administration's approach to manufacturing and harnessing American energy, ostensibly the reason for his visit.

Mr. Trump won Pennsylvania by less than 1 percentage point in 2016, although his victory was much more decisive in Beaver County, where he was Tuesday.

House Administration Committee Chairwoman Zoe Lofgren has demanded the White House and Trump campaign provide information about how the president's travel is financed. The president does have latitude to travel on the taxpayers' dime for official purposes and, unlike his White House staffers, is not subject to the Hatch Act prohibiting political speech by federal employees.

"The president frequently mixes official travel with campaign-related political purposes, which raises questions about whether American taxpayers are footing the bill for political travel that should be paid for by his campaign," Lofgren wrote in a May letter to White House Counsel Pat Cipollone.