Panama gained its independence from Colombia in 1903 primarily through a revolt against Colombian rule, with significant support from the United States. The context for this independence movement was Panama's long-standing dissatisfaction with Colombian governance and a desire for autonomy.
In the early 20th century, the United States was interested in constructing a canal across the Isthmus of Panama, which would significantly shorten maritime travel times between the Atlantic and Pacific Oceans. When negotiations with Colombia for the canal's construction and control stalled, the U.S. decided to support Panamanian revolutionaries in their efforts for independence.
On November 3, 1903, with U.S. naval presence ensuring their success, Panama declared its independence from Colombia. Following this, the U.S. quickly recognized the new Panamanian government. Shortly after, the U.S. and Panama signed the Hay-Bunau-Varilla Treaty, allowing the United States to build and control the Panama Canal.
Therefore, the correct answer would be: Panama revolted against Colombia with the help of the United States.