President Biden_2175841102_10082024_1
President Joe Biden jokes with a reporter as he leaves a news conference in the Brady Press Briefing Room at the White House on October 04, 2024. Andrew Harnik/Getty Images

US President Joe Biden on Tuesday unveiled a $3 billion investment towards port infrastructure in Maryland -- and took a swipe at Republican White House candidate Donald Trump a week before Election Day.

Biden's visit to the port of Baltimore, a key auto industry hub, came as his Vice President Kamala Harris remains in a tight contest with Trump for the right to succeed him.

"I'm proud to announce we're delivering $3 billion in funding from my Inflation Reduction Act to help clean up and modernize ports in 27 different states and territories, from Pennsylvania, Georgia, Michigan and beyond, including yes, Puerto Rico," he said.

Biden's jab came after a firestorm over a warm-up comedian at Trump's weekend rally in New York called Puerto Rico a "floating island of garbage."

Trump's campaign has since tried to distance the former president from the remarks.

Biden also played up his administration's efforts to modernize US infrastructure, saying his predecessor Trump has not done the same.

He pointed to investments from his government's policies going more to Republican-leaning states than Democratic ones, alongside the country's pandemic recovery.

"We're seeing the great American comeback," he said.

The White House said Tuesday that funds from the Inflation Reduction Act -- a package of energy transition policy and social reforms -- will go towards improving and electrifying port infrastructure.

This involves supporting purchases of battery- and hydrogen-powered equipment, including those used to handle cargo, alongside charging and fueling infrastructure.

The grants include $147 million in awards for the Maryland Port Administration.

US ports hire more than 100,000 union workers across the country.

As Election Day draws close, both Harris and Trump have been fighting to win over blue-collar workers, especially in swing states.

The grants announced Tuesday come under a "clean ports" program that authorities hope can improve air quality by installing "clean, zero-emission freight and ferry technologies along with associated infrastructure."

The aim is to eliminate more than three million metric tons of carbon pollution over 10 years.

"It's imperative to clean up our ports as soon as possible to alleviate serious public health issues," said Terrance Bankston, senior ports and freights campaigner at environmental nonprofit Friends of the Earth.

Biden's visit comes months after the collapse of the Francis Scott Key bridge in March, which closed ship traffic in and out of the port of Baltimore and killed six workers.