<?xml version="1.0"?>
<ownershipDocument>

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2025-04-02</periodOfReport>

    <notSubjectToSection16>1</notSubjectToSection16>

    <issuer>
        <issuerCik>0001447051</issuerCik>
        <issuerName>Territorial Bancorp Inc.</issuerName>
        <issuerTradingSymbol>TBNK</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001786297</rptOwnerCik>
            <rptOwnerName>Ohama John M</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>PAUAHI TOWER, 1003 BISHOP STREET</rptOwnerStreet1>
            <rptOwnerStreet2>SUITE 500</rptOwnerStreet2>
            <rptOwnerCity>HONOLULU</rptOwnerCity>
            <rptOwnerState>HI</rptOwnerState>
            <rptOwnerZipCode>96813</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2025-04-02</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>D</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>10000</value>
                    <footnoteId id="F2"/>
                </transactionShares>
                <transactionPricePerShare>
                    <footnoteId id="F1"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>0</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By Estate</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">Pursuant to a merger agreement between the Issuer and Hope Bancorp, Inc., each issued and outstanding share of Issuer common stock was converted into the right to receive 0.8048 shares of Hope Bancorp, Inc. common stock (subject to the payment of cash in lieu of fractional shares).</footnote>
        <footnote id="F2">Shares held by an estate over which Mr. Ohama is the executor.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Ned A. Quint, pursuant to power of attorney</signatureName>
        <signatureDate>2025-04-02</signatureDate>
    </ownerSignature>
</ownershipDocument>
