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

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2024-01-05</periodOfReport>

    <issuer>
        <issuerCik>0001323468</issuerCik>
        <issuerName>GLOBAL PARTNERS LP</issuerName>
        <issuerTradingSymbol>GLP</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001878766</rptOwnerCik>
            <rptOwnerName>Hanson Gregory B.</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>C/O GLOBAL PARTNERS LP</rptOwnerStreet1>
            <rptOwnerStreet2>800 SOUTH STREET, SUITE 500</rptOwnerStreet2>
            <rptOwnerCity>WALTHAM</rptOwnerCity>
            <rptOwnerState>MA</rptOwnerState>
            <rptOwnerZipCode>02453</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>0</isDirector>
            <isOfficer>1</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle>Chief Financial Officer</officerTitle>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common units representing limited partner interests</value>
            </securityTitle>
            <transactionDate>
                <value>2024-01-05</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>M</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>5436</value>
                    <footnoteId id="F1"/>
                    <footnoteId id="F4"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                    <footnoteId id="F1"/>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>22736</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common units representing limited partner interests</value>
            </securityTitle>
            <transactionDate>
                <value>2024-01-05</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>F</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>1494</value>
                    <footnoteId id="F2"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>42.00</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>21242</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <derivativeTable>
        <derivativeTransaction>
            <securityTitle>
                <value>Phantom Units</value>
                <footnoteId id="F3"/>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>0</value>
                <footnoteId id="F1"/>
            </conversionOrExercisePrice>
            <transactionDate>
                <value>2024-01-05</value>
            </transactionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>M</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>5436</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>0</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <exerciseDate>
                <footnoteId id="F4"/>
            </exerciseDate>
            <expirationDate>
                <footnoteId id="F4"/>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common units representing limited partner interests</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>5436</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>10873</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </derivativeTransaction>
    </derivativeTable>

    <footnotes>
        <footnote id="F1">Each phantom unit representing the right to receive one Common Unit upon vesting (&quot;Phantom Unit&quot;) converts into a common unit representing a limited partner interest in the Issuer (&quot;Common Unit&quot;) on a one-for-one basis.</footnote>
        <footnote id="F2">Each Common Unit was withheld at the request of the Reporting Person to satisfy the tax withholding obligations of the Reporting Person.</footnote>
        <footnote id="F3">Each Phantom Unit is the economic equivalent of one Common Unit.</footnote>
        <footnote id="F4">Pursuant to a Grant Agreement dated March 3, 2023, the Reporting Person was granted 16,309 Phantom Units.  Upon satisfying the vesting conditions set forth in said Grant Agreement, the Phantom Units cumulatively vested or will vest as follows:  one-third on January 5, 2024, one-third on January 5, 2025 and one-third on January 5, 2026.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>Amy J. Gould, Attorney-in-Fact for Gregory B. Hanson</signatureName>
        <signatureDate>2024-01-09</signatureDate>
    </ownerSignature>
</ownershipDocument>
