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

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2024-06-12</periodOfReport>

    <issuer>
        <issuerCik>0000011544</issuerCik>
        <issuerName>BERKLEY W R CORP</issuerName>
        <issuerTradingSymbol>WRB</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001236253</rptOwnerCik>
            <rptOwnerName>BERKLEY WILLIAM R JR</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>W. R. BERKLEY CORPORATION</rptOwnerStreet1>
            <rptOwnerStreet2>475 STEAMBOAT ROAD</rptOwnerStreet2>
            <rptOwnerCity>GREENWICH</rptOwnerCity>
            <rptOwnerState>CT</rptOwnerState>
            <rptOwnerZipCode>06830</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>1</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle>President and CEO</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <transactionDate>
                <value>2024-06-12</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>2534</value>
                    <footnoteId id="F1"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>2884966</value>
                    <footnoteId id="F2"/>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>900000</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>By William R. Berkley 2011 GST Trust</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">Represents award granted pursuant to the terms of the W. R. Berkley Corporation 2009 Directors Stock Plan, as amended and restated.</footnote>
        <footnote id="F2">Includes 1,972,462 shares of common stock underlying vested Restricted Stock Units (&quot;RSUs&quot;) (the receipt of which has been deferred) and does not include shares of common stock underlying unvested performance-based RSUs.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>William R. Berkley, Jr.</signatureName>
        <signatureDate>2024-06-12</signatureDate>
    </ownerSignature>
</ownershipDocument>
