In December 1989, in a military operation code-named Operation Just Cause, the U.S. invaded Panama. Noriega went into hiding but was later captured by US forces. President-elect Guillermo Endara was sworn into office. The United States ended Operation Just Cause in January 1990 and began Operation Promote Liberty, which was the occupation of the country to set up the new government until 1994.