“I feel, as many of my colleagues told me, that I’m often a bridge between the two sides of the aisle and there have been times when I have been able to make a difference,” she told reporters after her announcement. “I like playing that role, and there seem to be fewer and fewer senators who enjoy playing that role.”

Had she run and won the race for governor in 2018, she would have become the first woman in Maine to hold the office.

But while she has been one of the state’s most popular politicians for some time, there was no guarantee that she would win her party’s nomination in the June primary for governor.

Gov. Paul R. LePage, a fellow Republican and ally of Mr. Trump who is barred by term limits from seeking a third term, has been stirring the political pot against her. In the months before Ms. Collins’s announcement, Mr. LePage had tried to galvanize his base against Ms. Collins and discourage her from entering the race. Gov. LePage was traveling in Iceland on Friday, and his press secretary, Julie Rabinowitz, declined to respond to a request for comment.

Ms. Collins, who has glided to victory in her recent elections, this time faced the prospect of bruising and expensive attacks from the right. Far from being able to clear the field of competition, she would have entered a campaign free-for-all with at least 18 others so far — four Republicans, 10 Democrats and four third-party candidates.

“She hasn’t had a competitive election for a very long time, and so there’s much more uncertainty for her now than in previous elections,” said Amy Fried, a political scientist at the University of Maine. Ms. Fried predicted that Ms. Collins would have faced stronger attacks “in a way she just hasn’t had from her own party.”

Mary Mayhew, Mr. LePage’s former health and human services commissioner, who has cast herself in the LePage mold, may be the most immediate beneficiary of Ms. Collins’s decision.