The early morning vote along party lines came after 48 hours of furious negotiations to win over warring factions in the Republican conference.