* FTSEurofirst 300 index up 0.1 pct
* Index up 4 pct for July after June losses
* Merger hopes help German stocks outperform
* Commodities shares track weaker oil, metals
* UCB, BNP Paribas, Natixis up after results (Updates with closing prices, writes through)
By Atul Prakash
LONDON, July 31 (Reuters) - European shares marked a positive end to the month on Friday, as takeover hopes and positive earnings reports offset weakness in commodities and mining.
The FTSEurofirst 300 closed up 0.1 percent at 1,572.26 points, giving it a 4 percent gain for the month of July. A robust start to Europe's earnings season has helped lift stocks, along with relief earlier in the month when Greece agreed on terms for a new bailout.
Top gainers on Friday included Rolls Royce, up 5.9 percent after regulatory filings showed U.S. activist investor ValueAct had taken a 5.4 percent stake.
German potash miner K+S also rose 6 percent after remarks by Canada's Potash Corp spurred expectations that a takeover was more likely.
Elsewhere, good news from results season kept supporting stocks.
UCB surged 5 percent. The Belgian pharmaceutical company raised its 2015 forecasts as sales of its three major upcoming drugs propelled first-half earnings by more than expected.
BNP Paribas gained 2.9 percent after its revenue rose nearly 16 percent in the second quarter. Natixis was up 2.5 percent as it reported a 5 percent rise in net income.
"Overall, the results so far have been pretty good, with the banking sector putting in some good numbers as well," said Clairinvest fund manager Ion-Marc Valahu.
Airbus rose 3.5 percent after posting a 6 percent rise in first-half core operating profit.
According to Thomson Reuters StarMine, nearly half the STOXX Europe 600 companies have announced results so far. Of those, 53 percent have met or beaten analysts' forecasts.
On average, 48 percent companies beat analyst EPS (earnings per share) estimates in a quarter. Second quarter earnings are expected to grow by 5.7 percent from the corresponding quarter of the previous year.
The European oil and gas index fell 0.9 percent as oil prices fell after producers' cartel OPEC indicated there would be no output cuts despite a huge global oversupply, while the STOXX Europe 600 basic resources index was down 0.5 percent after copper fell on lingering worries about the metals' demand in top consumer China.
"Concerning China, all eyes are on the release of tomorrow's important manufacturing and non-manufacturing PMIs. Further indications that the economy is still not anywhere close to turning the corner could certainly spook Chinese stocks again," Markus Huber, senior analyst at Peregrine & Black, said.
A sell-off in Chinese shares over the past weeks have stoked concerns about a growth slowdown in the world's second-biggest economy.
Shares in BP and Statoil were down 1 to 2 percent.
Antofagasta slumped 2.3 percent, also under pressure after Goldman Sachs cut its target price for the stock of the company, which is buying half of Barrick Gold's Zaldivar copper mine for $1 billion in cash.
Europe bourses in 2015: link.reuters.com/pap87v
Asset performance in 2015: link.reuters.com/gap87v
Today's European research round-up
Additional reporting by Sudip Kar-Gupta; Editing by Tom Heneghan, Larry King