Several electronic signs along major roadways in New Bedford and Dartmouth were hacked Wednesday night with a kiss for Donald Trump and a jab for Hillary Clinton.

Among the messages on these electronic boards, which are owned by private contractors, and not the state, were: "Hillary 4 Prison" and "Trump 4 President," according to state and Dartmouth police, who both received calls about the hacking.

"I can confirm that several signs were hacked," Jacquelyn Goddard, director of communications for the state Department of Transportation, said Thursday afternoon.

The hacking was an isolated incident on roadways in Greater New Bedford, and speaking personally, Goddard said she has no idea how someone would hack into an electronic sign.

"We know of no other signs outside the Dartmouth area that were hacked" Wednesday night, she said. "I do not know how a person would go about hacking a sign."

State police are investigating the incident at the request of DOT, she said.

There were a total of five message boards — one on Interstate 195 eastbound near the Penniman Street exit in New Bedford; one at Route 140 southbound and I-195 westbound in New Bedford; and three on Faunce Corner Road, Dartmouth — that were hacked, according to state and Dartmouth police.

Motorists began reporting the incidents about 8:45 p.m., state police said. Dartmouth and state police reported the hacking to DOT and all the signs were corrected by 9:50 p.m.

However, there was a recurrence of the problem about 6:15 a.m. Thursday when someone hacked into the message board at Route 140 southbound and Interstate 195 westboard with the message: "I Like Boobs," state police said.

A motorist traveling Wednesday night from Dartmouth to Wareham said he was shocked by what he saw.

"I was absolutely stunned to see Hillary Number 4 Prison. I was flabbergasted,” Bruce Ditata, a 63-year-old retired teacher from East Wareham, who spotted the sign as he and sister were in their vehicle.

He said he immediately thought about reporting the incident and called the state police and was told the sign had been hacked and they were dispatching a cruiser.

Ditata said he travels about 25,000 miles a year and is accustomed to message boards that warn motorists about approaching storms, drunken driving and road conditions.

“It’s like a chilling scenario that someone could do that, and to me that was atrocious,” Ditata said.

One of the other signs said: "D---- Out For Harambe,” a reference to the gorilla in a Cincinnati Zoo that was killed when he grabbed and dragged a 3-year-old child in May.

There was no reaction Thursday afternoon from either the Clinton or Trump camps. Nicholas Black, a spokesman for the Clinton campaign in Massachusetts, did not respond to a phone and an email seeking comment. Trump's state campaign office in Hudson also did not respond to a request for comment.

The affected message signs are owned by JH Lynch, Faunce Corner Road, Dartmouth; and the Cardi Corp. Wamsutta Bridge Project, New Bedford, Goddard said in an email. They could not be reached for comment.

Follow Curt Brown on Twitter @CurtBrown_SCT