In difficult conditions, Connor Ronan's deflected first-half free-kick was the only goal of the game as Ireland booked their place in the top four in the competition and will face Brazil in the semi-finals on Wednesday.
Ireland dominated the gameand should have won by a more comfortable scoreline at the Stade Jules-Ladoumègue. Ronan's opener came just after the half-hour when his curling effort glanced off the Bahraini wall and found the net to give Stephen Kenny's side the lead.
It should have been two just minutes later. Josh Barrett was fouled in the area and after the referee pointed to the spot, skipper Jason Molumby saw his penalty saved and Barrett missed the target with the rebound.
Ireland continued to apply the pressure before the break and Barrett was unlucky not to score at the end of a free-flowing Irish move. Ronan found Aaron Connolly and after neat work from substitute Adam Idah, he found Barrett on the right side of the area but the keeper pulled off a brilliant diving save to deny the Reading man.
UCD defender Liam Scales headed a corner wide of the target either side of the break as Ireland continued to look for a second goal.
Ronan should have had his second of the game just five minutes after the break. He capitalised on an error from Bahraini keeper Ahmed to steal the ball and somehow finish from a tight angle, but the linesman harshly adjudged the ball to have gone out of play.
The tireless Aaron Connolly, Jayson Molumby and Idah all saw efforts blocked and saved in the final 15 minutes of the game as they failed to extend Ireland's lead.
"It's a fantastic achievement from the players. We're the youngest team in the group so for us to qualify shows the quality and maturity we've got in the side," said U-21 boss Stephen Kenny.
"We're also still the only European team left in the competition which is a tremendous achievement. It was really difficult out there today in the heat and we really had to battle it out after we missed those chances in the first-half.
"Bahrain are a good side though and to take seven points from the group is fantastic, we remain unbeaten going into the semi-finals so now we've got to recover and make sure we're right for that."
Republic of Ireland: Kelleher (GK), O'Connor, Scales, O'Shea, Leahy, Molumby (C), Ronan (Taylor 82), Barrett (Power 67), Knight (Coventry 46), Connolly, Elbouzedi (Idah 32).
Bahrain: Ahmed (GK), Alkhayyat, Bughammar, Mohamed, Alshamsi, Alasfoor, Marhoon, Hardan (C), Sanad, Alsherooqi (Ahmedi 46), Alshirah.
Referee: M. Johnson (MAL)