NEW YORK (TheStreet) -- Stocks extended major gains in the final hour of trading Friday as optimism over a Greek debt deal as soon as this weekend propped up markets.

The Dow Jones Industrial Average was up 1.3%, or 233 points, the S&P 500 increased 1.4%, and the Nasdaq climbed 1.6%. Benchmark indexes are looking to close the week with slight gains, a surprising feat after posting losses in five of the past six sessions. 

Stocks rallied after Greek Prime Minister Alexis Tsipras submitted the latest proposal of spending cuts. His plan mirrored suggestions from eurozone leaders that Greek voters rejected in a referendum over the weekend. The plan includes cuts to government spending, including pensions, and increased taxes.

"As far as we can gather the 'new' Greek proposal isn't markedly different from the ideas on the table when the Greeks overwhelmingly voted against the thing over the weekend," said David Ader, analyst at CRT Capital. "We suppose that poses political problems on the domestic front ... or is couched as an attempted, but failed, effort to get a better arrangement, but as far as the markets seem concerned is all a moot point."

Athens is seeking 53.5 billion euros ($59.9 billion) in bailout money. If approved, the deal would mark the third bailout loan for Greece. It already has received 240 billion euros in funds since 2010. Eurozone leaders will review the proposal and make a decision on the plan in meetings over the weekend.

Equities maintained highs even in the face of more comments from Federal Reserve Chair Janet Yellen that interest rates could rise later this year. In remarks to the City Club of Cleveland on Friday, Yellen said the economy is improving and the labor market tightening, which could prompt the central bank to raise rates soon.

"Based on my outlook, I expect that it will be appropriate at some point later this year to take the first step to raise the federal funds rate and thus begin normalizing monetary policy," Yellen said. 

"Yellen's comments were fairly neutral and kept the Fed's policy options wide open," said Laura Rosner, analyst at BNP Paribas. "A key detail was the mention of two-sided risks around the timing of lift-off. Her forecast is that a rate hike will be appropriate later this year, but 'unanticipated developments could delay or accelerate that first step.'"

Prior to the comments, expectations for a hike had largely been pushed out to 2016 after the minutes from the Fed's June meeting suggested a September hike was off the table given international risks. 

TD Ameritrade (AMTD) is the latest organization to experience technical difficulties in a week plagued by blackouts and glitches. The brokerage firm confirmed it experienced "widespread" issues executing orders but said on its Twitter page that the situation had been resolved. 

Apple (AAPL) looked to snap a five-session losing streak on Friday, adding 2.8%. Since the beginning of the month, shares have dropped 4.3%, hard hit by a market selloff tied to worries over instability in Chinese markets and uncertainty in Greece.

Gap (GPS) shares fell 0.6% after the retailer reported a 1% decline in same-store sales in June compared to an expected 0.5% drop. Total sales were flat at $1.54 billion, though rose 2% excluding currency.

American Airlines (AAL) added 4.1% after reporting traffic in June rose 2.8% with capacity increasing 2.4% to 23.9 billion available seat miles.

Unilever (UN) increased more than 4% following on an upgrade to "hold" from "underperform" at Jefferies. Analysts scrapped its bearish call given the company's outperformance against rivals Procter & Gamble (PG) and Kimberly Clark (KMB) so far this year.

Costco (COST) shares added nearly 3% after Oppenheimer upgraded the stock to "outperform" from "perform" and set a $160 price target. The firm said the retailer would likely raise membership fees and cut back on technology spending.