(Adds comments, detail, background)
HELSINKI, July 27 (Reuters) - Finnish network equipment maker Nokia reported larger than expected quarterly profits on Thursday thanks to a patent deal with Apple and improving profitability at its network business, but warned its key market would slow.
Network gear vendors have struggled in recent years amid weak demand from telecom operators, but Nokia has been outpacing Swedish rival Ericsson due to its 2016 acquisition of Franco-American rival Alcatel-Lucent.
Second-quarter group earnings before interest and taxes (EBIT) rose 73 percent from a year ago to 574 million euros ($674 million), well above analysts' average forecast of 447 million euros in a Reuters poll.
"In summary, a good second quarter, some challenges ahead this year, but also reasons to be optimistic about Nokia's ability to deliver," Chief Executive Rajeev Suri said in a statement.
He said the global network market would be more challenging in the full year than earlier forecast, citing uncertainty related to some projects.
"We now expect a decline in the market in the range of 3-5 percent, versus our earlier view of a low-single digit decline," Suri said.
Nokia's network business, which accounts for roughly 90 percent of its sales, is expected to decline in line with the market trends, he said.
Second-quarter sales in the networks business fell 5 percent to 4.97 billion euros, primarily due to weakness in its mobile networks business. Nonetheless, he said Nokia was still set to meet its year operating margin target of 8 to 10 percent.
"Weakening of general market outlook is a clear minus. But Nokia's profitability shows they are able to deliver good results in weak markets," said Inderes analyst Mikael Rautanen, who has an "accumulate" rating on the stock.
Nokia's total sales during the second quarter fell just 1 percent to 5.63 billion euros, aided by a jump in revenue from its technologies licensing unit, which rose 90 percent from the year-ago quarter thanks to the Apple deal.
Apple and Nokia settled their patent dispute in May with a broad agreement in which Nokia will get bigger patent royalties from Apple but will also supply network infrastructure products to the U.S. company, and collaborate with it in the digital health business.
($1 = 0.8514 euros) (Reporting by Jussi Rosendahl and Helena Soderpalm, Editing by Eric Auchard and Richard Pullin)