The companies said the deal was the "largest commercial transaction between a Panamanian and a US-based company ever."
Obama is in Panama to take part in a Summit of the Americas, which brings regional leaders together to discuss trade, job creation and a host of political issues.
The US president attended a ceremony to mark the deal, alongside Panamanian President Juan Carlos Varela, Boeing Chairman and CEO Jim McNerney and Copa CEO Pedro Heilbron.
Copa will in total buy 61 of Boeing's 737 MAX 8 and MAX 9 airplanes.
Also Read
"The Next-Generation 737 is the backbone for our fleet today, and our order for the 737 MAX shows our continued commitment for the future," said Heilbron.
Copa has pursued an aggressive bid to make Panama the "hub of the Americas" and is one of the region's largest airlines.
The time frame for the purchase was not immediately clear, but Boeing says it has 2,715 orders for the 737 MAX planes from 57 customers around the world.