NEW YORK (CNNMoney) -- U.S. stocks closed the day higher as investors grew more optimistic ahead of the crucial Greek elections this Sunday.
All three indexes ended higher for a second straight week. The Dow and S&P 500 jumped 1.7% and 1.3% respectively for the week, and the Nasdaq gained 0.5%.
While investors have been willing to take riskier bets on the notion that central banks are likely to flood markets with cash early next week, contagion risks still abound.
Some experts say that a Greek exit from the eurozone could thrust global markets into a state of chaos.
"The market has been grinding higher today on the thought that we'll get some sort of resolution with Greece this weekend," said Douglas DePietro, managing director in institutional equities at Evercore Partners.
Shares of the National Bank of Greece () rose 13% and GREK ( ), a Greek ETF, jumped 9%.
The S&P 500 () moved up 14 points, or 1%, and the Nasdaq ( ) added 36 points, or 1.3%.
But there are concerns that anti-austerity political parties in Greece will win enough seats in parliament to derail the bailout program secured earlier this year.
Investors were heartened after European central bankers signaled they would provide more cash to help banks deal with the ongoing sovereign debt crisis.
Early Friday, European Central Bank President Mario Draghi said the bank would "continue to supply liquidity to solvent banks where needed." He said strengthening European economies is crucial, and that it's time to implement plans to spur long-term growth.
Draghi's comments came one day after Bank of England Governor Mervyn King said the central bank and the Chancellor of the Exchequer are working on new policies to provide funding to banks for "several years" at rates below current market rates.
The yields on Spanish 10-year bonds improved slightly Friday, falling to 6.95% from the high just above 7% early Thursday.
Economy: The Empire State Manufacturing Index plummeted to 2.3 in June, according to the Federal Reserve Bank of New York, down from 17.1 in May. The index was expected to stand at 13.5, according to a consensus of economist forecasts from Briefing.com.
The University of Michigan Consumer Sentiment Index for June slid to 74.1 from 79.3 in May. The number fell below expectations of 77, according to a consensus from Briefing.com.
Companies: Shares of Facebook ( ) spiked more than 6%, giving the company a second-straight day of gains. This would be only the second instance of two-day gains since its IPO on May 18.
World markets: European stocks closed higher. Britain's FTSE 100 ( ) added 0.2%, while the DAX ( ) in Germany rose 1.5% and France's CAC 40 ( ) gained 1.9%.
Asian markets were mostly higher at the close. The Shanghai Composite () rose 0.5%, the Hang Seng ( ) in Hong Kong jumped 2.3% but Japan's Nikkei ( ) edged up only 0.01%.
The Bank of Japan decided to keep its rates steady -- close to zero -- and not take additional easing measures.
Oil for July delivery edged up 12 cents to $84.03 a barrel.
Gold futures for August delivery rose $8.50 to $1,628.10 an ounce.
Bonds: The price on the benchmark 10-year U.S. Treasury rose, pushing the yield down to 1.59% from 1.63% 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||3.94%||3.93%|
|15 yr fixed||3.03%||3.03%|
|30 yr refi||4.02%||3.99%|
|15 yr refi||3.09%||3.07%|
Today's featured rates: