The Dow Jones industrial average rose 46 points to 12,782 in the first half hour of trading. The Standard & Poor's 500 rose 4 points to 1,356. The Nasdaq rose 7 points to 2,950.
European finance ministers agreed early Tuesday on the terms of a bailout for Spain, saying that the first $37 billion in aid can be ready by the end of the month. Unemployment in Spain is nearing 25 percent.
The yield on Spain's benchmark 10-year government bond fell to 6.7 percent and its stock market surged following the news. On Monday, country's 10-year borrowing rate surged to 7 percent, a dangerously high level. The lower yield means investors are less fearful about the country having trouble paying its debts.
Portugal, Ireland and Greece all had to ask for help from international lenders after spikes in their own borrowing rates made it unaffordable for them to raise money from selling bonds on the open market. Spain is the largest European country to date to seek international assistance.
ASML Holding, the world's largest supplier of equipment to computer chip makers, surged following news that Intel intends to take a 15 percent stake in the company for $3 billion. Intel will also help fund ASML's research into new technologies. The stock jumped $3.88 to $52.34.
Alcoa lost 23 cents to $8.52 after a financial analyst cut his estimate for the company's 2012 earnings. The aluminum maker was the biggest loser among the 30 companies in the Dow index. Alcoa reported Monday that it beat analyst estimate for earnings in the second quarter but that revenue dropped due to weaker profits and slowing world demand for the metal.