NEW YORK (TheStreet) -- Stocks extended modest gains by mid-afternoon Thursday as Greece barrelled toward a midnight deadline. 

The S&P 500 added 0.59%, the Dow Jones Industrial Average was up 0.55%, and the Nasdaq climbed 0.61%. 

Greece's government was under the gun again on Thursday as Greek Prime Minister Alexis Tsipras faces a midnight deadline to propose new spending-cut plans for further debt relief. The country is seeking a three-year loan from the eurozone to save it from bankruptcy and keep it in the euro.

Germany has conceded the debt-ravaged country will need debt relief in order to stay above water. Finance Minister Wolfgang Schaeuble told a conference on Thursday that "reprofiling" Greece's debt could entail extending loan maturities and cutting interest rates. 

Crude oil recovered Thursday after a recent selloff, closing 2.2% higher at $52.78 a barrel, buoyed by government action in China to stem massive market declines. Major oilers Chevron (CVX), Schlumberger (SLB) and Halliburton (HAL) spiked on the crude rally, while the Energy Select Sector SPDR (XLE) added 1%.

U.S. stocks had surged above 1% earlier Thursday as Chinese stocks ended a five-day losing streak after the country's securities regulator banned major stockholders with holdings worth more than 5% from selling their stakes for the next six months. The Shanghai Composite jumped 5.8%, nearly reversing a massive decline a day earlier.

The move had a positive impact on China based, U.S.-listed stocks. Chinese search engine Baidu (BIDU) gained 2.1%, Melco Crown Entertainment (MPEL), which owns casinos in Asia, climbed 3.7%, and the largest of China-based stocks, Alibaba (BABA), surged more than 2%.

The Federal Reserve continued to give markets some pep after minutes from its June meeting indicated the central bank could delay any rate hike later than expected. Many economists had expected a hike in September.

Chicago Fed President Charles Evans pushed his rate hike timeline out even further in comments made on Thursday. Evans said he doesn't want to increase rates until mid-2016 given risks stemming from Europe and China. 

"I just don't see why we should be in a hurry with all the risks that we face," he told reporters on Thursday morning. 

The IMF cut its outlook for U.S. economic growth to 2.5% compared with a forecast in April of 3.1%. The body made note it believes the sluggishness at the beginning of the year to be temporary. Global growth forecasts were cut to 3.3% for 2015, down from 3.5%.

The New York Stock Exchange said it halted trading for nearly four hours on Wednesday due to a technical glitch related to a software update. 

"The update to the gateways caused additional communication issues between the gateways and trading units, which began to manifest themselves mid-morning," the exchange explained in a release on Thursday.

U.S. jobless claims unexpectedly increased 15,000 to 297,000 in the week ended July 3, according to the Department of Labor. Economists had expected the number of new claims for unemployment benefits to fall to 276,000.

"Today's unexpected increase in initial claims, marking the highest weekly reading since February, likely reflected some seasonal distortion around the Independence Day holiday," said Josh Nye, economist at RBC Economics. "We expect initial claims will return closer to the levels seen during the last two months following the latest week's holiday distortion."

Procter & Gamble (PG) has agreed to enter a merger of its beauty brands with Coty (COTY) in a deal worth $12.5 billion. The deal includes Procter's hair care, cosmetics and fragrance brands. 

Walgreens Boots Alliance (WBA) jumped 4.2% after beating third-quarter estimates of 87 cents a share by 15 cents. Comparable-store sales rose 1.6% in the quarter. The company also named Stefano Pessina its permanent CEO after Pessina oversaw the merger of Walgreen and Boots Alliance last year.

Alcoa (AA) reported a mixed second quarter, earning 19 cents a share, 4 cents short of expectations, while generating a 1% increase in revenue. Shares added 2.3% as sales increased on the back of strong organic revenue growth in the company's aerospace and automotive businesses. Alcoa marked the unofficial kickoff to the second-quarter earnings season.

Yahoo! (YHOO) shares added nearly 2% after the Internet company announced the launch of a daily fantasy sports portal. This marks Yahoo!'s entrance into a highly lucrative market. Market research firm Ipsos estimated 57 million fantasy sports players spend more than $400 on annual fees to participate.