(Reuters) - Halliburton Co HAL.N on Monday reported a second-quarter profit that beat analysts' estimates as its largest oil-well services unit exceeded expectations, sending shares to their biggest one-day gain in nearly three years.

FILE PHOTO: Halliburton’s campus in Houston, Texas, U.S. May 18, 2017. REUTERS/Daniel Kramer

The Houston-based oilfield company is the largest provider of hydraulic fracturing services in North America, a segment of the business that has been hard-hit by overcapacity, making it difficult to raise prices.

Halliburton Chief Executive Officer Jeff Miller said that market remains oversupplied and the company idled equipment during the quarter and will continue to do so. It has also taken steps to cut costs by reorganizing its North American business.

Halliburton shares, which have declined nearly 18.2% this year, closed up 9.15%, or $1.99 a share, to $23.74, marking the largest percentage gain since November 2016.

Revenues for the Completion and Production unit, which provides hydraulic fracturing services and tools to complete oil and gas wells, rose 4% from the prior quarter to $3.8 billion. Margins were boosted by cost-cutting and maximizing equipment usage, Miller said on a conference call.

The company cut the number of North American employees by 8% in the second quarter, spokeswoman Emily Mir said on Monday.

Byron Pope, an oilfield analyst for Tudor, Pickering, Holt & Co, said, “The magnitude of the improvement in the Completions and Production margin performance” was encouraging, adding that it was good to hear the company publicly acknowledge that it has idled equipment.

Despite the improvements, CEO Miller warned investors that third-quarter activity would decline as producer customers continue to focus on reducing spending.

“We expect that activity in North America will be slightly down in the third quarter. We anticipate the slowdown to be more pronounced in the gassier basins due to persisting lower gas prices,” he said.

Halliburton posted a strong increase in revenue from international markets, jumping more than 12% to $2.60 billion, in contrast to the 13.2% decline in North America to $3.33 billion.

“Momentum is building internationally and activity improvement should continue into 2020,” Miller said in a statement.

Rival Schlumberger NV SLB.N on Friday reported a profit increase on demand from markets outside North America.

Net profit attributable to Halliburton fell 85% to $75 million, or 9 cents per share, in the quarter, hurt by impairments and other charges.

Excluding one-time items, the company earned 35 cents per share, beating Wall Street’s average estimate of 30 cents per share, according to IBES data from Refinitiv.

Revenue fell 3.5% to $5.93 billion and missed estimates of $5.97 billion.