Virtually every city and state in North America wants to host Amazon's second headquarters. That includes Puerto Rico.

The hurricane-battered U.S. territory managed to submit its application to Amazon (AMZN) by last Thursday's deadline.

"We have completed and fulfilled the application to enter the race for Amazon's headquarters," Puerto Rico's Economic Development and Commerce Department said on Facebook over the weekend.

It's no secret that Puerto Rico is a long-shot candidate. Much of its infrastructure has been decimated by Hurricane Maria, which slammed the island on September 20. Only 23% of the island has electricity, according to government data. One quarter is without running water.

"We know we are the underdogs of the group," Manuel Laboy, the economic development agency's top official, told Puerto Rican news outlet El Nuevo Dia.

Related: Amazon could put its second HQ in Canada. But will it?

But Puerto Rico wanted to show that it could bounce back from Maria, according to Laboy.

It could also really use the $5 billion investment and 50,000 jobs that will come with Amazon's so-called HQ2.

The hurricane left parts of the island in ruin. Many of its 3.4 million residents have left -- and there are concerns about whether they'll return. The government estimates that it will be two more months before 95% of power is restored.

Related: Misery in Puerto Rico: No power, no job, 'enormous' lines

Even before the hurricane, the territory's economy needed a boost. Amid an 11-year recession, Puerto Rico filed for the largest municipal bankruptcy in U.S. history back in May. Unemployment was more than double the national rate, and many young workers were looking for jobs elsewhere.

Amazon said Monday that 238 cities and regions throughout the U.S., Mexico and Canada submitted bids for HQ2.

-- CNNMoney's Patrick Gillespie contributed to this report.