Gunmen attacked Libya's interior ministry building in the capital Tripoli late Tuesday, forcing its closure.