LONDON July 18 (Reuters) - Anglo American said its copper output was almost flat in the first half, while it curbed this year's output forecast for coking coal, which is likely to weigh on earnings just months after it rebuffed a takeover bid from rival BHP Group.

Copper production rose 2% to 393,800 metric tons in the six months through June and is on track to meet full-year guidance, Anglo said in a statement.

Copper demand is expected to rise sharply in coming years for use in applications ranging from solar panels and electric cars to data centres for artificial intelligence.

Anglo cut its output guidance for steelmaking coal to between 14 million tons to 15.5 million tons from 15 to 17 million tons previously, as it battles an underground fire at its Grosvenor coal mine in Australia that started on June 29.

Anglo has put its five operating coal mines, development projects and joint ventures in Australia up for sale, as part of a wider plan to divest less profitable assets and focus on expanding copper output after BHP's failed attempt to take over the company. But analysts say the timing and value of a planned sale of coal assets are now uncertain.

"The mine has been stabilised and we are re-establishing comprehensive underground gas monitoring, prior to being able to assess the steps towards a safe re-entry into the mine," Anglo said in a statement on Thursday.

Assessment of the damage and re-opening is likely to take several months, the company said. (Reporting by Clara Denina and Felix Njini; editing by Jason Neely and Sharon Singleton)