Trentin proved the strongest in a five-man sprint on Glasgow Green, with Dutch multi-talent Mathieu Van Der Poel taking the silver and Belgium's Wout Van Aert the bronze.
Former world champion Marta Bastianelli of Italy won the women's race on Sunday 5 August.
The men had to tackle the technical, looped city-centre course on streets slick with rain, making it a 230km hell on wheels for the riders, with several spectacular crashes. The 51 finishers from the 136 starters crossed the line with their faces blackened as if they has spent almost six hours down a Scottish coal mine rather than racing 16 times round Glasgow's landmarks. It was no surprise that all three medallists had a cyclo-cross background, with Van Der Poel a former world champion and Van Aert his successor in the rainbow jersey.
"I had a chat with Van Der Poel at the beginning of the race and he said just that, 'It looks like cyclo-cross', Trentin said. "That's true. It was like one million corners, wet, up and down all day. They were the two to watch for the race and I beat them, so that's good.
"I broke a vertebrae four months ago and I broke a rib six months ago. The beginning of the season was pretty bad. This is a really good comeback after all the bad luck I had earlier."
The trio were part of an 11-man breakaway that was reduced significantly by a crash about 10km from the finish, effectively leaving five men fighting for the medals.
Jesus Herrada Lopez of Spain and Trentin's team-mate Davide Cimolai finished fourth and fifth respectively in the same time as the winner: five hours, 50 minutes, 02 seconds.
Slovakia's pre-race favourite Peter Sagan, who won the inaugural elite men's title in 2016, abandoned early on the 11th lap, admitting he was still suffering from a crash when on his way to a sixth green points jersey at last month's Tour de France.
"I was not in good shape and I still have a lot of pain from my crash," Sagan said. "It was a very technical course and it was really hard. I think I really needed more time to recover for this race."
Reigning champion Alexander Kristoff (NOR) finished 11th, two minutes 22 seconds down on Trentin, who took over in the blue stripes and gold starred jersey of the winner.
Bastianelli won the women's race also in a sprint finish to end Dutch domination of the event. Marianne Vos (NED) was second with Germany's Lisa Brennauer third.