Media in Libya said the attack struck the al-Jahfal training camp.
The training centre had been a military base during the rule of ousted Libyan leader Muammar Gaddafi.
Libya has been hit by instability since his overthrow in 2011, and there is concern Islamic State (IS) militants are gaining a foothold there.
A spokesman for the ministry of health of the rival government based in the capital, Tripoli, told the BBC that 47 people were killed and more than 100 people were injured in the blast, which was reportedly heard 60km (40 miles) away in Misrata.
Other news agencies have put the death toll at 50.
It is being reported that it was a water truck rigged with explosives which caused the bombing.