According to the police, the two men, aged 21 and 24, had already made several fireworks when one of the improvised explosives, a kind of pipe bomb, exploded on Wednesday evening. The apartment was in the attic of a building in Strausberg in the state of Brandenburg.
The men fled the building after the explosion, but were caught by police later. The 21-year-old suffered severe burns and cuts to his face, and was taken to hospital in Berlin.
The 24-year-old, who suffered some damage to his ear drums, was arrested on suspicion of causing an explosion.
Specialists have since secured the building.