The nations have formally recognized each other's sovereignty, ending a state of war. U.S. Secretary of State Marco Rubio was key to the deal.