NEW YORK (CNNMoney) -- U.S. stocks rose Friday, capping the best week of the year, amid speculation that Spain will request a bailout for its troubled banking sector over the weekend.
The Dow Jones industrial average () rose 93 points, or 0.7%, to end at 12,554. The S&P 500 ( ) gained 11 points, or 0.8%, to 1,326. The Nasdaq ( ) was up by 27 points, or 1%, to 2,858.
The major gauges all posted the largest weekly gain of 2012. The Dow rose 3.6%, the S&P gained 3.5% and the Nasdaq was 3.9% higher for the week.
Overall, the gains were driven by hopes for a coordinated intervention by global central banks to support the economy. On Thursday, China's central bank announced a surprise interest rate cut. The European Central Bank held rates steady at its meeting Wednesday, but many analysts expect the ECB to cut rates next month.
Federal Reserve chairman Ben Bernanke told lawmakers Wednesday that the U.S. central bank stands ready to act, but he offered no hint that additional stimulus measures are imminent. Bernanke's comments came after other Fed officials suggested the bank could extend a policy of reinvesting proceeds from assets on its balance sheet into the Treasury market, known as Operation Twist.
"There's a lot of uncertainty out there," said Bernard Kavanagh, vice president of portfolio management for St. Louis-based broker Stifel Nicolaus. "I'm surprised we didn't see more selling given the strong week we've had."
Meanwhile, investors remain focused on Europe, particularly the banking crisis in Spain.
Spain could formally request bailout funds from the European Union as soon as this weekend, according to Reuters. But EU officials and the Spanish government say a request for help will not be made until a full assessment of the banking sector is complete.
On Thursday, Fitch slashed Spain's credit rating three notches to 'BBB' from 'A.' The ratings agency pointed to the estimated cost of a Spanish bank bailout, which it said is likely to cost between €60 billion and €100 billion. Fitch also said it expects a prolonged recession in Spain that will run throughout 2013.
The yield on 10-year Spanish bonds rose to a high of 6.6% last week, prompting a warning from the nation's Treasury minister that the government is in danger of being priced out of the market. But yields eased this week following a successful bond auction on Thursday and are now around 6.2%.
Joseph Saluzzi, co-head of equity trading at Themis Trading, said traders do not want to bet the market will fall Monday in case EU leaders announce a rescue plan for Spain over the weekend.
"The shorts have been burned time and again," he said. "No one wants to come in here and take a stand."
U.S. stocks ended mixed Thursday, trimming gains from earlier in the day. Investor sentiment remains in the "extreme fear" range on CNNMoney's Fear & Greed index, although it has eased in the last few days.
Asian markets ended Friday trading lower, reacting to both the Chinese rate cut and Bernanke's comments. The Shanghai Composite () closed down 0.5%, the Hang Seng ( ) in Hong Kong lost 0.9%, and Japan's Nikkei ( ) fell 2.1%
Economy: The U.S. trade deficit for April came in at $50.1 billion, roughly in line with forecasts of analysts by Briefing.com, and down from the revised $52.6 billion in March.
Wholesale inventories for April rose by 0.6%, after increasing by 0.3% in the month prior.
Companies: Shares of International Game Technology ( ) edged up after the gaming firm announced late Thursday that it had received a recommendation for an online gaming license from the Nevada Gaming Control Board.
Shares of Molina Healthcare (Fortune 500) jumped after the company announced late Thursday that Ohio had endorsed its bid to continue as a health care provider for the state's Medicaid beneficiaries.,
Shares of McDonald's (Fortune 500) and KFC-owner Yum! Brands ( , Fortune 500) declined Friday amid growing fears about slowing economic growth in China. McDonald's announced that its sales at stores open at least a year in Asia, the Middle East and Africa regions declined 1.7% in May, with particular weakness in Japan and China.,
Oil for July delivery continue its slide, losing 72 cents to settle at $84.10 a barrel.
Gold futures for June delivery rose $3.40 to end at $1,591.40 an ounce, reversing earlier losses.
Bonds: The price on the benchmark 10-year U.S. Treasury rose, pushing the yield near down to 1.64% from the 1.65% level reached late Thursday.
|What we want Apple to unveil at WWDC|
|Millennials squeezed out of buying a home|
|7 traits the rich have in common|
|Big Data knows you're sick, tired and depressed|
|Your car is a giant computer - and it can be hacked|
|Overnight Avg Rate||Latest||Change||Last Week|
|30 yr fixed||4.19%||4.26%|
|15 yr fixed||3.23%||3.27%|
|30 yr refi||4.17%||4.23%|
|15 yr refi||3.21%||3.25%|
Today's featured rates: