It’s bad enough when a semitruck and trailer roll over during rush hour.

But it’s even worse when you can’t get the rig into a safe enough position to get traffic moving again — for hours.

A rollover accident that caused only minor injuries Wednesday morning turned into a logistical nightmare because of the topography where it occurred, according to a spokeswoman with the state Department of Transportation.

State troopers say the driver of the semi was headed north on Interstate 5, near the Michigan Street exit in Seattle, when he swerved left to avoid a car that had cut him off.

In doing so, however, the truck driver struck another vehicle, went through the barrier and rolled down the sloped median between the north- and southbound lanes, said State Patrol spokesman Chris Webb.

The Seattle Fire Department said the three people in the car struck by the semi — a 1-year-old child, a 34-year-old woman and a 35-year old man — suffered minor injuries. The 39-year-old truck driver was uninjured, police said.

Nevertheless, northbound lanes were closed for hours for emergency vehicles and road crews. And the southbound lanes were closed off and on due to fear that the truck would roll down the hill and into the southbound lanes, according to the State Patrol and the Department of Transportation (DOT).

“Our first priority was to keep southbound drivers and our crews safe in case the semi were to roll downhill,” said DOT spokeswoman Harmony Weinberg.

Webb said the truck could not be righted easily because it was carrying 65,000 pounds of equipment that was unstable after the rollover.

Almost six hours after the 9:30 a.m. accident, workers were able to use heavy-duty wreckers to ease the semi down the steep median and into a ditch near the southbound lane barrier, where it was determined to be stable.

All of the lanes were finally reopened by 3 p.m., said Weinberg.

She said crews planned to return around 10:30 p.m. on Wednesday — “when most of the people are gone” — to finally remove the semi.

The process was likely to include closing the left two lanes of southbound I-5 again for a period of time, she said.

“We understand it was a total inconvenience,” said Weinberg, “but it was just a crazy, weird location and a unique situation.”

Christine Clarridge can be reached at cclarridge@seattletimes.com or 206-464-8983.