Fast-food chain Jack in the Box is saying adios to ailing Mexican fast-casual brand Qdoba, which has experienced a downturn that it partly blames on higher avocado prices.

Funds led by publicly traded investment group Apollo Global Management will pay about $305 million for the Qdoba chain, which is struggling with fast-casual competition as well as higher labor expenses, it was announced Tuesday.

San Diego-based hamburger chain Jack in the Box had announced months ago that it was considering strategic options for Qdoba, including a possible sale.

The company acquired Qdoba in 2003 when it had only 85 locations in 15 states and $65 million in sales. Jack in the Box grew Qdoba into a major national brand with more than 700 restaurants in 47 states and 2017 fiscal-year sales of more than $820 million.

But Qdoba has stumbled in recent quarters. Sales at Qdoba stores open at least a year fell 1.4% in the 2017 fiscal year, including a 3% drop for company-owned locations.

More:This restaurant just unseated Chipotle as the most popular Mexican chain

More:Tight-fisted diners flock to fast food, not midprice restaurants

More:5 restaurants that prove Millennials still love fast food

The trend worsened in the fourth quarter, with company-owned same-store sales down 4% and overall same-store sales down 2.1%.

A 50% jump in avocado prices took a bite out of Qdoba's fourth-quarter performance, and wage increases also hurt earnings, Chief Financial Officer Jerry Rebel said Nov. 30 on a conference call.

Analysts say the company needs to convert more company-owned locations into franchises.

The deal to sell Qdoba to Apollo is expected to close by April.

“We are extremely excited to be acquiring Qdoba and look forward to working with the management team, employees and franchisees to continue building the Qdoba brand," Apollo Senior Partner Lance Milken said in a statement. "We are firmly committed to Qdoba’s continued growth as a leading fast-casual restaurant operator.”

Jack in the Box's stock closed up Tuesday 3.1%, or $3.11, to $103.45, up $3.11. Apollo Global Management was off 0.4% to $32.50, down 13 cents.

Apollo has a wide-ranging set of investments, including consumer brands Hostess, GNC and Samsonite. It has invested in companies across many sectors, including chemicals, transportation, financial services, manufacturing and media.

Follow USA TODAY reporter Nathan Bomey on Twitter @NathanBomey.