A blast from an explosive device has seriously injured three people at a residential building in Monaco, and the attacker fled to France, local authorities said.