The 80-year-old Cochran, who is chairman of the Senate's Appropriations Committee, has been ill since at least last year with urological problems.
Mississippi Gov. Phil Bryant, a Republican, will appoint someone to replace Cochran temporarily.
Bryant's pick would maintain the GOP's narrow, 51-seat majority in the 100-seat Senate — at least for now.
But a special election will be held in November to select a permanent replacement for the remainder of Cochran's term.
The state's other U.S. senator, Roger Wicker, is running for re-election this year. Wicker, who is also a Republican, faces a primary challenge from Chris McDaniel.
Mississippi is a solidly Republican state, giving the party a decided edge in holding on to both Senate seats. But the GOP's loss of a Senate seat from Alabama in a special election in December won by Democrat Doug Jones underscores the fact that nothing is certain in politics.
"I regret my health has become an ongoing challenge," Cochran said in a prepared statement. "I intend to fulfill my responsibilities and commitments to the people of Mississippi and the Senate through the completion of the 2018 appropriations cycle, after which I will formally retire from the U.S. Senate."
"It has been a great honor to serve the people of Mississippi and our country. I've done my best to make decisions in the best interests of our nation, and my beloved state," Cochran said.
"My top concern has always been my constituents in Mississippi. My hope is by making this announcement now, a smooth transition can be ensured so their voice will continue to be heard in Washington, D.C. My efforts, and those of my staff, to assist them will continue and transfer to my successor."
Cochran most recently was re-elected in 2014.
Cochran was the first Republican in more than a century to win a state-wide election in Mississippi. He is the 10th-longest-serving senator in U.S. history.
Before winning his Senate seat, Cochran served three terms in the House of Representatives.