Security forces were battling five assailants who entered a building housing two ministries in Mogadishu. The militant group Shabab claimed responsibility.