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

    <schemaVersion>X0609</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2026-06-30</periodOfReport>

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

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001034657</rptOwnerCik>
            <rptOwnerName>STERNLICHT BARRY S</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerNonUSAddressFlag>false</rptOwnerNonUSAddressFlag>
            <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>
            <isOfficer>true</isOfficer>
            <isTenPercentOwner>false</isTenPercentOwner>
            <isOther>false</isOther>
            <officerTitle>CEO, Chairman of the Board</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>false</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2026-06-30</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>M</transactionCode>
                <equitySwapInvolved>false</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>276666</value>
                </transactionShares>
                <transactionPricePerShare>
                    <footnoteId id="F1"/>
                    <footnoteId id="F2"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>3561724</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By controlled entities</value>
                    <footnoteId id="F3"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>14407616</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <derivativeTable>
        <derivativeTransaction>
            <securityTitle>
                <value>Restricted Stock Units</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <footnoteId id="F4"/>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2026-06-30</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>M</transactionCode>
                <equitySwapInvolved>false</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>276666</value>
                    <footnoteId id="F1"/>
                    <footnoteId id="F2"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <footnoteId id="F1"/>
                <footnoteId id="F2"/>
            </exerciseDate>
            <expirationDate>
                <footnoteId id="F1"/>
                <footnoteId id="F2"/>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common Stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>276666</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>1450004</value>
                    <footnoteId id="F5"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By controlled entities</value>
                    <footnoteId id="F3"/>
                </natureOfOwnership>
            </ownershipNature>
        </derivativeTransaction>
    </derivativeTable>

    <footnotes>
        <footnote id="F1">On June 30, 2026, SPT Management, LLC, the issuer's external manager (the &quot;Manager&quot;), acquired 276,666 shares of the issuer's common stock in connection with the vesting of (i) 108,333 of the restricted stock units originally granted to the Manager on March 4, 2024 (the &quot;2024 RSUs&quot;), (ii) 112,500 of the restricted stock units originally granted to the Manager on March 6, 2025 (the &quot;2025 RSUs&quot;), and (iii) 55,833 of the restricted stock units originally granted to the Manager on March 10, 2026 (the &quot;2026 RSUs&quot;), each as an award under the Starwood Property Trust, Inc. 2022 Manager Equity Plan.</footnote>
        <footnote id="F2">The remaining 2024 RSUs, the remaining 2025 RSUs and the remaining 2026 RSUs will vest ratably in quarterly installments through December 31, 2026, December 31, 2027, and December 31, 2028, respectively, in each case subject to the Manager's continued service as the issuer's external manager. As such restricted stock units vest, the awards will be settled in shares of the issuer's common stock promptly, but in no event later than 30 days, following the applicable quarterly vesting dates.</footnote>
        <footnote id="F3">Represents securities held by entities directly or indirectly controlled by Mr. Sternlicht, including the Manager, SFIP, LLC and JAWS Capital, LP. Mr. Sternlicht disclaims beneficial ownership of these securities except to the extent of his pecuniary interest therein, and the inclusion of these securities in this report shall not be deemed an admission of beneficial ownership of all of the reported securities for purposes of Section 16 or for any other purpose.</footnote>
        <footnote id="F4">Each restricted stock unit represents a contingent right to receive one share of the issuer's common stock.</footnote>
        <footnote id="F5">Represents the 1,300,000 2024 RSUs, the 1,350,000 2025 RSUs and the 670,000 2026 RSUs granted to the Manager, less those restricted stock units that have already vested and been converted into shares of the issuer's common stock.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>/s/ Barry S. Sternlicht</signatureName>
        <signatureDate>2026-07-02</signatureDate>
    </ownerSignature>
</ownershipDocument>
