Thousands of union workers at a western Pennsylvania petrochemical plant were given a choice last week — show up for President Donald Trump's speech on Wednesday or stay home and lose some of their weekly pay.

One of the construction site's contractors wrote in rules for the speech ahead of the event that employees' attendance was "not mandatory," though it said only those who arrived at 7 a.m. with their work IDs scanned and stood for hours to wait for the president would be paid for their time.

“NO SCAN, NO PAY,” those rules, which were handed out to employees prior to the speech, read. That memo was first reported by the Pittsburgh Post-Gazette, which noted that those who opted against attending Trump's address would have an excused, unpaid absence and would not qualify for overtime pay on Friday. The publication reported workers were told "anything viewed as resistance" to Trump was prohibited. The speech was arranged to foster "good will" with building trade unions, The Post-Gazette added.

Ray Fisher, a spokesman for Shell, told NBC News in an email that workers who opted to stay away from the speech would still be paid for the week, but less than those who scanned in and were on site Wednesday.

The day “was treated as a training (work) day with a guest speaker who happened to be the president,” Fisher said, adding the company does "these several times a year with various speakers."

Fisher said a morning session ahead of the speech, which focused on "safety training and other work-related activities" began at 7 a.m. and lasted for three hours.

Set to focus on energy policy, Trump's speech at the new multi-billion dollar Royal Dutch Shell facility in Beaver County, which will convert natural gas into plastic, often veered into other subjects. Trump claimed the presidency was "costing me a fortune" he estimated to be between $3 and $5 billion. Trump said he was "going to speak to some of your union leaders to say, 'I hope you’re going to support Trump.' Okay?"

"And if they don’t, vote them the hell out of office because they’re not doing their job," he added. "It’s true. It’s true. Vote them out of office."

The warehouse Trump spoke in was packed with workers in yellow and orange vests who had been bussed in from part of the massive construction site. Two workers, who declined to speak on the record, told NBC News they were missing their lunch break to attend and had packed snacks in their pockets because they weren’t allowed to bring in food.

Several workers said a lot of people didn’t show up because they don’t like Trump, particularly the strong union supporters. One worker said he didn’t really want to come, but thought it would look bad to miss a day of work and wanted to get his full pay.

The event went past 3 p.m., when many of the workers' regular shift ended — causing workers to worry they wouldn’t get paid for the extra time they spent holding in the warehouse.

Dozens of workers tried to leave early, before Trump had even finished as 3 p.m. approached, but they were told Secret Service wouldn’t let them out of the warehouse until Trump had left the property. After his speech ended, Trump took a tour of the construction site.

Once Trump had finished speaking the workers were still being held and were letting out boos and angry shouts because they weren’t being let out. At 3:30 p.m., a plant employee tried to calm the crowd and let them know they would be getting paid for the time they were still there.

The site employs at least 5,000 people and is one of the largest in America. There are at least two dozen construction cranes here rising out of the rolling hills — a feature Trump made note of in his address.

"Getting this massive job done right has required more than 1,500 pieces of heavy equipment; one of the largest cranes anywhere in the world — I look forward to seeing it," Trump said. "I love cranes. I loves trucks of all types. Even when I was a little boy at four years old, my mother would say, 'You love trucks.' I do. I always loved trucks. I still do. Nothing changes. Sometimes, you know, you might become President but nothing changes. I still love trucks, especially when I look at the largest crane in the world. That’s very cool. Do you think I’ll get to operate it? I don’t know. We’ll put the media on it, and I’ll give them a little ride, right?"

The White House hopes the massive construction project will serve as a symbol of the Trump economy in a key swing state. When complete, the facility will employ about 500 workers manufacturing plastic pellets made from ethane, a byproduct of fracking, that can be used in products like food packaging and auto parts.

The White House and Shell did not immediately respond to requests for comment from NBC News.