It was actually a triple win for Italy, as Consonni's compatriots Matteo Pelucchi of Bora-Hansgrohe and Nicolo Bonifazio of Bahrain-Merida finished second and third, respectively.
"I managed to take advantage of a good position in the chaotic finish and win. I almost fell myself but I managed to avoid it. I did not expect to win, and I'm very happy," Consonni told reporters after the race.
The best competitor not coming from Italy was Slovenian Luka Mezgec, who finished fourth, while Rok Korošec was the second best Slovenian in the first stage, finishing eighth.
Mezgec agreed that he could have done more. "I started sprinting a bit too early", he said.
There were two group crashes in the last kilometre of the stage, with some of the favourites to win it all staying behind.
The 159-km stage in the north-east of the country crossed the border with Hungary for the first time in the history of the prime stage cycling race in Slovenia.
Tomorrow, the cyclists will take on a 153-km stage from Maribor to Rogaška Slatina. Two more stages will follow daily until Saturday, with the race concluding on Sunday with a 21.5-km time trial.
* results of the first stage of the Tour of Slovenia: 1 Simone Consonni (ITA/UAE Team Emirates) 3:32:05 2 Matteo Pelucchi (ITA/Bora Hansgrohe) 3 Niccolo Bonifazio (ITA/Bahrain Merida) 4 Luka Mezgec (SLO/Mitchelton-Scott) 5 Rick Zabel (GER/Katjuša Alpecin) 6 Sondre Holst Enger (NOR/Israel Cycling Academy) 7 Timo Roosen (NED/LottoNL Jumbo) 8 Rok Korošec (SLO/My Bike-Stevens) 9 Sacha Modolo (ITA/Education First-Drapac Cannondale) 10 Luca Colnaghi (ITA/Sangemini-MG.Kvis) ... 15 Matej Mohorič (Slo/Bahrain-Merida) all same time