Senator Heidi Heitkamp of North Dakota issued an apology on Tuesday for an ad her campaign ran that incorrectly identified victims of sexual abuse, throwing her uphill re-election bid further off balance just three weeks before the midterms.

Ms. Heitkamp, one of the Democrats’ most endangered incumbents, ran a newspaper ad criticizing comments her Republican opponent, Representative Kevin Cramer, made about victims of sexual misconduct. The ad, which was made to look like an open letter to Mr. Cramer, included the names of more than 120 women.

After the ad ran, however, several women took to social media to say they had not given permission for Ms. Heitkamp’s campaign to use their names.

“We recently discovered that several of the women’s names who were provided to us did not authorize their names to be shared or were not survivors of abuse,” Ms. Heitkamp said in a statement on Tuesday.