NEW YORK – Stocks ended a rough week with slight gains Friday after Libyan government forces declared a cease-fire and a group of the world’s seven largest countries announced a plan to bring the yen down from historic highs.

Financial stocks rose after JPMorgan and other large banks increased their dividends. JP Morgan said it was increasing its dividend to 25 cents a share from 5 cents. Wells Fargo and U.S. Bancorp also raised their dividends.

Japan’s currency has soared since an earthquake struck the country a week ago and caused devastating tsunami waves and damage to several nuclear plants.

A stronger yen makes it more difficult for Japan’s export-driven economy to recover by making Japanese goods more expensive overseas.

“This is a bit of a relief rally,” said Paul Zemsky, head of asset allocation at ING Investment Management. “The situation in Japan looks to be stabilizing, or at least not getting any worse, and it looks like it may be solvable.”

News early Friday that Libya’s foreign minister had declared a cease-fire helped push stocks higher, but opposition forces said shelling was still occurring after the announcement and they accused the Libyan government of lying. Britain and France were taking the lead in plans to enforce a no-fly zone over Libya.

The Dow Jones industrial average gained 83.93 points, or 0.7 percent, to 11,858.52. The Standard & Poor’s 500 index rose 5.49, or 0.4 percent, to 1,279.21. The Nasdaq composite index gained 7.62, or 0.3 percent, to 2,643.67.

All three stock indexes ended the week lower after markets were battered by worries over Japan’s ability to get its nuclear crisis under control. The Dow lost 1.5 percent, the S&P 500 1.9 percent and the Nasdaq 2.6 percent.