The penalty is yet another setback for the world champion early in the season.
The International Motoring Federation had earlier rejected his bid to overturn Sebastian Vettel’s lead over a technicality after last month’s Australian.
In Bahrain Hamiton had been fourth fastest after Friday’s warm-up sessions.
Kimi Raikkonen put in the fastest performance as he and Ferrari teammate Vettel dominated the session ahead of the two Mercedes, headed by Valtteri Bottas.
Hamilton said the practice had all been part of a “normal Friday”, until his penalty was announced.
"It's very close and we have some work to do," he said. "The tyres feel the best they have here in years, very stable with less degradation."
Raikkonen had narrowly missed a grid penalty of his own as he clocked a best lap time of one minute and 29.817 seconds to outpace four-time champion Vettel by 0.011 seconds.
Officials opened a faced a post-race investigation into a possible unsafe release of his car, by Ferrari, following a routine pit-stop late in the session.
After pulling away he saw his pit crew waving their arms and pulled up at the side of the track.
Ferrari feared he could be punished for an unsafe release, because his front right wheel was not attached properly, and given a grid penalty, but instead Ferrari were fined 5,000 euros.