Stocks held in the green on Thursday as relief over a patient Federal Reserve fueled market gains. 

The S&P 500 was up 0.5%, the Dow Jones Industrial Average jumped 0.5%, and the Nasdaq rose 0.7%. Stocks had come off of session highs by mid-afternoon. 

The Fed signaled plans to keep rates lower for longer on Wednesday. The dot-plot forecast and comments from Fed Chair Janet Yellen supported the case for gradual tightening after a small increase in rates this December, as is widely anticipated. 

"Lower for longer is perceived as good news," said Brad McMillan, chief investment officer for Commonwealth Financial Network. "With the strong hint about December, markets are clearly on notice, but the lower growth and interest rate projections show that, on balance, the Fed's revised policy stance is considered positive."

The Nasdaq posted a new record close and the S&P 500 and Dow rallied on Wednesday after the Fed opted not to raise interest rates for another month. 

The majority of investors are now pricing in the likelihood of a December rate hike. Chances are now at 52%, according to CME Group fed funds futures, up from 48% before the announcement on Wednesday.

"The Fed appears to be positioning for a hike in December, and at this stage we see that outcome as more likely than not," BNP Paribas analysts wrote in a note. "Saying it is waiting for more evidence in the time being, despite the case for a rate hike having strengthened, suggests that barring significant events the rate hike will not be long in coming."

U.S. jobless claims fell to their lowest level since July in the past week, according to the Labor Department. The number of new claims for unemployment benefits fell by 8,000 to 252,000. Analysts expected the number to tick up to 261,000. Claims have held below 300,000 for 81 weeks in a row, their longest streak since 1970. 

Constrained supply led to an unexpected dip in existing home sales last month. The National Association of Realtors reported a 0.9% decline in August to a 5.33 million annual rate, its second straight monthly decline. Economists forecast a 5.44 million rate.

Crude oil prices moved higher again on Thursday as a steep decline in weekly inventories released a day earlier continued to feed confidence in a slow recovery in commodities. U.S. oversupply, weaker global demand and breakneck output from some of the world's largest oil producers have beaten down oil prices over the past two years.

West Texas Intermediate crude was up 2.2% to $46.32 a barrel on Thursday.

In earnings news, Red Hat (RHT) increased 3% after boosting guidance in the wake of a better-than-expected quarter. The developer of open-source platform Linux expects per-share earnings between $2.23 and $2.25 a share for the full year, up from a previous range of $2.19 to $2.23 a share.

Chief Financial Officer Frank Calderoi credited the company's recent quarterly performance with a "record number of deals over $1 million" and overall solid demand. Technical analyst Bruce Kamich of Real Money, TheStreet's premium site for active traders, writes that it's "not unrealistic" to expect Red Hat to hit $87 a share from the stock's current $80 or so. Real Money subscribers can check out his analysis here (non-subscribers can sign up for a free 14-day trial).

Bed Bath & Beyond (BBBY - Get Report) rose 0.5% despite the company missing estimates on its top- and bottom-lines. Second-quarter earnings of $1.11 a share fell short of consensus by 6 cents, while revenue of $2.99 billion was shy of forecasts by $60 million. Comparable-store sales fell 1.2%, an unexpected drop, as the retail environment remained competitive.

Rite Aid (RAD - Get Report)  fluctuated after a mixed quarter. The pharmacy chain earned an adjusted 3 cents a share, a penny above consensus. Sales increased nearly 5% to $8 billion, though fell short by $200 million. Same-store sales growth of 2.5% came in higher than an estimated 1.9%. Rite Aid's acquisition by Walgreens Boots Alliance (WBA - Get Report) is expected in the second half.

Walgreens Boots Alliance is a holding in Jim Cramer's Action Alerts PLUS Charitable Trust Portfolio. Want to be alerted before Cramer buys or sells WBA? Learn more now.

AutoZone (AZO)  saw small losses despite beating profit estimates. The auto parts retailer earned $14.30 a share in its fiscal fourth quarter, up from $12.75 a share a year earlier. Analysts expected earnings of $14.25 a share. The company opened 71 new stores over the quarter, boosting inventory by 6.1%. Same-store sales in the U.S. climbed 1%, half what analysts expected.

B&G Foods (BGS - Get Report) agreed to acquire the spices and seasonings unit of ACH Food Cos. in a deal worth $365 million. B&G expects the deal to close in the fourth quarter and add annual adjusted earnings of 26 cents to 28 cents a share to its bottom line.

Lennar (LEN - Get Report) gained 1% after agreeing to purchase WCI Communities (WCIC) in a deal worth $643 million. Lennar offered $23.50 in cash and stock for every WCI share, an offer that values WCI at a 37% premium to its Wednesday close. WCI shareholders will vote on the acquisition offer at the end of the year. WCI jumped 39.5%.

Mylan (MYL - Get Report) rose 1.8% Thursday after CEO Heather Bresch testified before a congressional panel on Wednesday, justifying the price hikes of the drugmaker's life-saving EpiPens. The list price of EpiPens has grown to $608 for a two-pack, an increase of more than 500% since 2007.

Amazon (AMZN - Get Report) added 1.5% after being upgraded to buy at Argus. The firm said the company is experiencing growth and expanding margins at a faster pace than the stock currently factors. 

SeaWorld (SEAS - Get Report) climbed 8% after Citi analysts upgraded the stock to buy from neutral. Analysts said a recent selloff and lowered consensus estimates have made the "risk/reward more interesting." SeaWorld slumped recently after suspending its quarterly dividend to bankroll share repurchases.