She called the drink-driving incident "the greatest mistake of my life".
Hadzialic, who arrived in Sweden aged five from Bosnia-Hercegovina, drank two glasses of wine before being stopped on the bridge linking Denmark and Sweden.
She faces a possible term of up to six months in prison after police detected a blood-alcohol level of 0.2 grams per litre.
Explaining her error, she said she had drunk one glass of sparkling wine and one of red after a night out in Copenhagen. She set off for Sweden's southern city of Malmo four hours later.
Hadzialic said she thought that would have been enough time for her body to get rid of the alcohol.
Explaining her decision to quit, the Social Democrat told reporters: "I choose to do this because I believe what I have done is that serious."
Sweden is one of several European countries which have low alcohol limits for drivers.
Drink-drive limits (grams per litre of blood)
UK, Malta: 0.8 (Scotland 0.5)
United States: 0.8
Most European countries, including Germany, France, Spain, Italy: 0.5
Sweden, Poland, Estonia, Cyprus: 0.2
Czech Republic, Hungary, Romania, Slovakia - no alcohol while driving
A 0.5-limit would mean an average man can take take a small glass of beer or a large glass of wine and women up to half a pint of beer or a small glass of wine.