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

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2025-09-30</periodOfReport>

    <issuer>
        <issuerCik>0001465128</issuerCik>
        <issuerName>STARWOOD PROPERTY TRUST, INC.</issuerName>
        <issuerTradingSymbol>STWD</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001223489</rptOwnerCik>
            <rptOwnerName>ZELNICK STRAUSS</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O STARWOOD PROPERTY TRUST, INC.</rptOwnerStreet1>
            <rptOwnerStreet2>2340 COLLINS AVENUE</rptOwnerStreet2>
            <rptOwnerCity>MIAMI BEACH</rptOwnerCity>
            <rptOwnerState>FL</rptOwnerState>
            <rptOwnerZipCode>33139</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>true</isDirector>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>false</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2025-09-30</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>7744</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <footnoteId id="F2"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>85029</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>2600</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By spouse</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>11800</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By family trusts</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">Represents restricted shares of the issuer's common stock vesting on September 30, 2026.</footnote>
        <footnote id="F2">The issuer granted these shares to Mr. Zelnick pursuant to the Starwood Property Trust, Inc. 2022 Equity Plan.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Rina Paniry, his attorney-in-fact</signatureName>
        <signatureDate>2025-10-02</signatureDate>
    </ownerSignature>
</ownershipDocument>
