American and Southwest are raising fares by $5 each way, the latest move by airlines to reverse a price slump that has lasted nearly two years.

American Airlines Group Inc. raised prices first and Southwest Airlines Co. followed suit on Thursday, according to J.P. Morgan Securities and FareCompare. Both airlines confirmed the price increase.

Fares have been falling since airlines began adding flights and seats faster than the growth in travel demand.

On Wednesday, Southwest Airlines Co. shares tumbled 8.5 percent after the company gave a weak forecast for a key revenue figure in the fourth quarter. The forecast suggested that lower fares are likely to last through year end.

Even when airlines announce increases in their base rates, that doesn’t mean customers pay more. Airlines run frequent fare sales, especially when demand is weak.

Still, the fare hike led J.P. Morgan to upgrade Southwest shares to “overweight.”

Shares of Southwest gained 84 cents, or 2.2 percent, to $39.24; American rose 60 cents, or 1.5 percent, to $39.92; and some other airline stocks gained by smaller percentages.

This article was from The Associated Press and was legally licensed through the NewsCred publisher network.

Photo Credit: Southwest and American airlines are raising fares. Pictured, Southwest Airlines employees celebrated its new uniforms and interior August 9, 2016. Stephen M. Keller / Southwest Airlines