Keith Ellison easily bested four other challengers in the DFL primary for attorney general and will face former state Rep. Doug Wardlow, the GOP-endorsed candidate, in November.
Ellison garnered about half of all DFL votes in the primary election, which had a higher-than-expected voter turnout.
Wardlow grabbed 46 percent of the Republican votes to win that contest.
"I think it's important to have an attorney general who's going to stand up for the rule of law and enforce all of our laws and not pick and choose," he said. "That means that we need to restore public safety, rebuild the criminal law division of the office and lift the burden of regulation off job creators as well."
Ellison heads into the general election marred by a recent controversy.
His campaign faced a late hurdle when a former girlfriend's son alleged on social media that Ellison had physically abused her. The son and the woman said there was a video recording of the incident. Ellison denied the incident took place and the woman refused to make the video public.
"We had a very unexpected event at the end of this campaign that happened. I want to assure you that it is not true," Ellison said Tuesday night. "And we are going to keep on fighting all the way through."
Ellison beat state Rep. Debra Hilstrom, DFL-endorsed candidate Matt Pelikan, former Ramsey County Attorney Tom Foley and former Commerce Commissioner Mike Rothman.
The office came open when three-term incumbent Lori Swanson jumped into the governor's race in June after she faced a challenge for the DFL endorsement at the party's state convention in Rochester.
Pelikan, 36, a Minneapolis lawyer and first-time candidate, won that endorsement after Swanson dropped out of the race. He took less than 11 percent of the primary vote.
Swanson's decision not to seek a fourth term led to a rush of additional Democrats into the attorney general's race and launched a 10-week intra-party struggle.
Ellison raised the most money and attracted most of the attention.
He promised to be the "people's lawyer" and said he would use the office to oppose President Trump's efforts if he believed they violated the Constitution. His decision to leave a safe DFL seat in Congress touched off a spirited primary for that 5th District seat.
On the Republican side, Wardlow was challenged in the primary by former DFL state Sen. Bob Lessard and frequent candidate Sharon Anderson. Neither Lessard nor Anderson are lawyers, which is not a requirement for the attorney general post.