Exhibit 23
Consent of Independent Registered Public Accounting Firm
The Board of Directors
Territorial Bancorp Inc.:
We consent to the incorporation by reference in the registration statements No. 333-1688839 and No. 333-170579 on Form S-8 of Territorial Bancorp Inc. of our reports dated March 14, 2012, with respect to the consolidated balance sheets of Territorial Bancorp Inc. as of December 31, 2011 and 2010, and the related consolidated statements of income, stockholders’ equity and comprehensive income, and cash flows for each of the years in the three-year period ended December 31, 2011, and the effectiveness of internal control over financial reporting as of December 31, 2011, which reports appear in the December 31, 2011 annual report on Form 10-K/A of Territorial Bancorp Inc.
/s/ KPMG LLP
Honolulu, Hawaii
April 17, 2012