A Southwest Airlines Boeing 737-700, registration N565WN performing flight WN-118 from Phoenix,AZ to Atlanta,GA (USA), was enroute at FL390 about 170nm westsouthwest of Amarillo,TX (USA) when the crew initiated an emergency descent to 9000 feet due to the loss of cabin pressure, the passenger oxygen masks were released. The aircraft diverted to Amarillo for a safe landing about 35 minutes after leaving FL390. The airline confirmed the loss of cabin pressure deploying the passenger oxygen masks due to a technical malfunction. A replacement Boeing 737-700 registration N278WN reached Atlanta with a delay of 5 hours. The occurrence aircraft positioned back to Phoenix at maximum altitude 10,000 feet departing Amarillo about 14 hours after landing. The aircraft has not yet resumed service about 27 hours after landing in Amarillo.