Labor pressure and unpredictably high medical and legal expenses weighed heavily on Cheesecake Factory's second-quarter earnings, prompting the company to cut its forecast and sparking a sell-off of its shares Wednesday.

The casual dining chain's stock shed about 13 percent Wednesday. The stock has gained 1.8 percent this year.

CEO David Overton blamed minimum wage increases and high employee turnover as well as higher medical insurance costs and an increase in legal expenses for the miss on the bottom line.

Higher wages, overtime payments and $4.6 million in higher medical insurance expenses resulted in labor costs that were 35.8 percent of the company's revenues in the quarter, an increase of 1.9 percent from last year, CFO Matthew Clark said on an earnings call Tuesday.

"I think the Labor Department just came out this afternoon and said it was the highest Employee Cost Index that they've seen in a decade," Clark said. "So, you're definitely seeing some broader pressure there as well."

He said that hourly wage rate inflation is now 6 to 7 percent.

In addition to labor costs, Cheesecake Factory said it paid $4.5 million in legal expenses during the quarter, which also put pressure on the bottom line. In June, the company was found liable in a wage theft case involving hundreds of underpaid janitorial workers at several California restorations.

Net income in the quarter ended July 3 fell to $28.4 million, or 61 cents per share, from $38.2 million, or 78 cents per share, in the year earlier period. Excluding items, Cheesecake Factory earned 65 cents per share, missing Thomson Reuters' analyst expectations of 81 cents per share.

Revenue rose 4 percent to $593.2 million, in line with Wall Street's forecast.

Same-store sales, a key metric for restaurant companies, grew 1.4 percent in the quarter, in line with analyst expectations cited by StreetAccount.

Cheesecake Factory revised its forecast and now expects earnings per share to be between $2.40 and $2.48, compared with the $2.62 to $2.74 range it had forecast previously.

Full-year same-store sales growth are now expected to be in a range of 1.5 to 2 percent, narrower than the 1 to 2 percent the company predicted previously.