Exhibit 23.2

Consent of Independent Registered Public Accounting Firm

We consent to the reference to our firm under the caption “Experts” in the Registration Statement (Form S-3) and related Prospectus of S&T Bancorp, Inc. and subsidiaries for the registration of perpetual preferred stock, a warrant to purchase its common stock and the common stock underlying the warrant, and to the incorporation by reference therein of our report dated February 23, 2007, with respect to the consolidated balance sheet of S&T Bancorp, Inc. and subsidiaries as of December 31, 2006, and the related consolidated statements of income, shareholders’ equity, and cash flows for each of the two years in the period ended December 31, 2006, included in its Annual Report (Form 10-K) for the year ended December 31, 2007, filed with the Securities and Exchange Commission.

/s/ Ernst & Young LLP

Pittsburgh, Pennsylvania

February 13, 2009