PORTLAND, Maine — Thursday’s heat caused problems on the rail lines.

People heading to and from Maine by train saw some major delays.

Commuters saw delays on the Downeaster from Boston to Brunswick, up to 45 minutes, but Amtrak said it was for the passengers’ safety.

These heat restrictions were put in place on all tracks from the Massachusetts-New Hampshire border all the way up to end of the line in Brunswick.

The Downeaster usually travels at almost 80 miles per hour between Boston and Portland, but that speed had been cut in half Thursday.

With trains only able to go 40 miles per hour, Amtrak said the heat restrictions are put in place for safety reasons, because the steel rail the trains run on actually can expand and warp when temperatures get as high as they were Thursday.