* S&P 500 sets new closing high, Europe also rallies
* Political tensions keep bonds, euro trading cautiously
* Euro hits 8-month lows against dollar, bund yields fall
* Crude prices gain as U.S. stockpiles fall (Adds close of U.S. markets)
By Herbert Lash
NEW YORK, July 23 (Reuters) - Global equity markets edged higher on Wednesday as a backdrop of solid corporate earnings buoyed risk appetite, but worries over the Middle East and Ukraine kept demand strong for safe-haven assets such as bonds.
Shares in Europe, in emerging markets and most of Wall Street rose, with the benchmark S&P 500 closing at a new record high as results continued to top forecasts.
Of the 149 companies in the S&P 500 that have reported results, 68.5 percent have beat expectations, a bit better than the past four quarters and five percentage points above the 20-year average of 63 percent, according to Thomson Reuters data.
“The bottom line is investors have moved away, for now, from the big political stories and are refocused on earnings, which in general have been good,” said Rick Meckler, president of hedge fund LibertyView Capital Management in Jersey City, New Jersey.
“There’s just not a lot of bad news out there when it comes to corporate earnings,” he said.
MSCI’s all-country world index rose 0.21 percent, while the FTSEurofirst 300 rose 0.14 percent to close at 1,375.69.
But the Dow bucked the broader trend pulled lower by a 2.3 percent drop in Boeing Co shares after investors were spooked by rising costs in its military tanker program.
The Dow Jones industrial average closed down 26.91 points, or 0.16 percent, to 17,086.63. The S&P 500 gained 3.48 points, or 0.18 percent, to 1,987.01 and the Nasdaq Composite added 17.681 points, or 0.4 percent, to 4,473.697.
The prospect of more sanctions against Russia over the Ukraine crisis and a downed Malaysian airliner kept risk aversion on the table in the bond market, where German 10-year yields nudged down to 1.147 percent, just shy of record lows.
Bund futures rose 32 ticks to settle at 148.32.
Benchmark 10-year U.S. Treasuries slipped less than 1/32 in price to yield 2.4673 percent.
The euro was 0.03 percent lower at $1.3460, while the dollar was 0.04 percent higher against the Japanese yen at 101.50.
Crude oil futures rose on both sides of the Atlantic after oil stockpiles in the United States fell more than expected, and amid ongoing tensions in Ukraine and the Middle East.
Brent crude for September delivery settled up 70 cents at $108.03 a barrel. U.S. crude for September delivery rose 73 cents to settle at $103.12 a barrel.
Reporting by Herbert Lash, additional reporting by Lionel Laurent in London; Editing by Nick Zieminski and Diane Craft