* Italy forms government after months of uncertainty
* Apple rises, sets groundwork for first-ever debt sale
* Moody's and McGraw rally as lawsuits get settled
* Indexes up: Dow 0.9 pct, S&P 0.9 pct, Nasdaq 1 pct
By Ryan Vlastelica
NEW YORK, April 29 (Reuters) - U.S. stocks rose on Monday, extending a recent rally as Italy formed a government and relieved a two-month-long overhang of geopolitical uncertainty from the market.
In addition, better-than-expected housing data boosted market optimism and put the S&P 500 on track to set a record close after rising for six of the past seven sessions.
Wall Street followed European stocks higher as Italy's new Prime Minister Enrico Letta's focus on growth and away from austerity in his inaugural speech lifted hopes for further stimulus from the European Central Bank.
"After the election there was a lot of uncertainty about whether Italy could form a government, so now there is not only a great deal of relief over that, but also expectations for additional monetary policies from the ECB," said Alec Young, global equity strategist at S&P Equity Research in New York.
Policymakers of the ECB and the U.S. Federal Reserve will meet separately this week, and the Fed is expected to maintain its stimulus. Data on Monday showing muted inflation continued to give the Fed room for accommodative measures.
Also lifting markets was Apple Inc, which jumped 3.5 percent to $431.53 after taking initial steps for what would be its first debt sale, which is set to be one of the most anticipated bond sales of the year. Technology stocks rose 1.7 percent the best-performing sector on the day.
A report showed contracts to buy previously owned homes rose last month to their highest level since April 2010, showing underlying strength in the housing market recovery, even though the pace of sales growth has cooled in recent months.
The Dow Jones industrial average was up 126.17 points, or 0.86 percent, at 14,838.72. The Standard & Poor's 500 Index was up 13.93 points, or 0.88 percent, at 1,596.17. The Nasdaq Composite Index was up 34.17 points, or 1.04 percent, at 3,313.43.
The S&P 500 is about a point away from 1,597.35, its all-time intraday high, which it hit earlier this month. If the index closes above 1,593.37, that will mark a new all-time closing high.
"The market's trend continues to be higher, but it is still attractive at these valuations," said Young, who has a 12-month target of 1,670 for the S&P.
Moody's Corp was the S&P 500's top percentage gainer, jumping 9.4 percent to $60.29 after the company settled a lawsuit alleging that it had misled investors about the safety of risky debt vehicles it had rated.
McGraw-Hill Cos, whose Standard & Poor's unit said it settled similar suits, rose 3.2 percent to $53.64.
Roper Industries Inc fell 3.5 percent to $118.96 after reporting first-quarter revenue that missed expectations, though it raised its full-year profit outlook.
Of the 274 companies in the S&P 500 that have reported earnings to date for current season, 69 percent have beat analysts' expectations and 43.2 percent have reported revenue above expectations.
The second half of the earnings season may not be as strong as the first one, data showed.