Flanagan has expressed relief after a meeting with the board of the embattled NRL club on Friday morning.
New chairman Glenn Coleman fronted a media conference with Flanagan after the meeting and announced he would resume coaching duties immediately and guide the Sharks in their home game on Sunday against the Warriors.
Flanagan was stood down two weeks ago by the board while four other senior staff were sacked amid the anti-doping investigation which has plunged the club into crisis.
But Flanagan retained the full backing of the Shark's playing squad and the possibility he could be reinstated arose when Damian Irvine quit as chairman last week, with Coleman taking over.
"It's been a tough couple of weeks," Flanagan said on Friday.
"It's been terrible. It's been hard of families, friends, players ... I'm glad we've sorted this out.
"My focus now is on the players, Sunday's game and the season ahead."
The Sharks called a media conference for Coleman and Flanagan at the club at 10.15am (AEDT) with announcement on his return.
Flanagan was stood down two weeks ago by the board while four other senior staff were sacked amid the anti-doping investigation which has plunged the club into crisis.
Flanagan has retained the full backing of the Sharks playing squad and the possibility he could be reinstated arose when Damian Irvine quit as chairman last week, with Coleman taking over.
Interim Cronulla coach Peter Sharp earlier this week admitted he had no idea if Flanagan would be reinstated, but said everyone involved with the side wanted him back.
"He's the coach of this football club and everybody in the football club wants him back, myself included," Sharp said on Monday.
"Let's hope we get some closure on that as well."
The board cited "management issues" when it suspended Flanagan and sacked football manager Darren Mooney, head trainer Mark Noakes, physiotherapist Konrad Schultz and club doctor David Givney.
It's understood those related to failing to inform the board when alleged problems with the club's supplement regime - now the subject of an Australian Anti-Doping Authority investigation - were detected in 2011 and the club parted ways with sports scientist Stephen Dank.
Dank has strongly denied any wrong-doing, as have Flanagan and the four sacked staff.
Coleman said the board had reviewed the club's football operations and decided to reinstate Flanagan to see out his contract.
He said the club was standing by its decision to terminate the contracts of Mooney, Noakes, Schultz and Givney.