(For a Reuters live blog on U.S., UK and European stock markets, click LIVE/ or type LIVE/ in a news window)

Jan 18 (Reuters) - Wall Street's main indexes closed lower on Wednesday after weak economic data and hawkish comments from Federal Reserve officials sparked worries that the central bank will keep tightening policy, perhaps enough to cause a recession.

Before the market opened, U.S. economic data showed retail sales and producer prices declined more than expected in December. Also production at U.S. factories fell more than expected in December and output in the prior month was weaker than previously thought.

"It seems that investors are finally coming to the conclusion that getting inflation under control is not a free lunch and that all the tightening the Fed has had to do to get inflation moving in the right direction, comes with economic costs," said Michael Reynolds, vice president of investment strategy at Glenmede.

"Investors may have had this false belief that this soft landing scenario was a higher probability event than it actually is."

According to preliminary data, the S&P 500 lost 62.12 points, or 1.56%, to end at 3,928.85 points, while the Nasdaq Composite lost 138.17 points, or 1.25%, to 10,956.95. The Dow Jones Industrial Average fell 615.67 points, or 1.81%, to 33,296.63.

With Wall Street's major averages showing gains so far for 2023, Sam Stovall, chief investment strategist at CFRA research, said some investors saw the week data as an opportunity to take profits.

"The market was overbought. Today's economic data served as a trigger to initiate a profit taking spell and the groups with most profits to take have been the ones that have done best last year," said Stovall.

Earlier, St. Louis Fed President James Bullard and Cleveland Fed President Loretta Mester stressed on the need to raise rates beyond 5% to bring inflation to heel.

The Fed commentary also highlighted the disparity between the U.S. central bank's estimate of its terminal rate and market expectations, which were of the rate peaking at 4.88% by June. Traders are now betting on a 25-basis point rate hike in February.

Investors are also focused on the fourth-quarter earnings season as a window into how corporate America is doing against the backdrop of higher interest rates.

Analysts now expect year-over-year earnings from S&P 500 companies to decline 2.6% for the quarter, according to Refinitiv data, compared with a 1.6% decline in the beginning of the year.

IBM Corp shares were in the red after Morgan Stanley downgraded the company's shares to "equal weight" from "overweight".

Moderna Inc shares rose after reporting data which demonstrated the effectiveness of its respiratory syncytial virus (RSV) vaccine.

PNC Financial Services Group Inc shares tumbled after the company missed estimates for its fourth-quarter profit. (Reporting by Sinéad Carew in New York, Shreyashi Sanyal and Amruta Khandekar in Bengaluru; Additional reporting by Shubham Batra; Editing by Shounak Dasgupta and David Gregorio)