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

    <schemaVersion>X0508</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2025-11-06</periodOfReport>

    <notSubjectToSection16>0</notSubjectToSection16>

    <issuer>
        <issuerCik>0001049521</issuerCik>
        <issuerName>MERCURY SYSTEMS INC</issuerName>
        <issuerTradingSymbol>MRCY</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001998597</rptOwnerCik>
            <rptOwnerName>JANA Partners Management, LP</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>888 SEVENTH AVENUE</rptOwnerStreet1>
            <rptOwnerStreet2>24TH FLOOR</rptOwnerStreet2>
            <rptOwnerCity>NEW YORK</rptOwnerCity>
            <rptOwnerState>NY</rptOwnerState>
            <rptOwnerZipCode>10106</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>0</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>1</isOther>
            <officerTitle></officerTitle>
            <otherText>See Remarks</otherText>
        </reportingOwnerRelationship>
    </reportingOwner>

    <aff10b5One>0</aff10b5One>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common Stock, par value $0.01 per share</value>
            </securityTitle>
            <transactionDate>
                <value>2025-11-06</value>
            </transactionDate>
            <deemedExecutionDate></deemedExecutionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>S</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
                <footnoteId id="F1"/>
            </transactionCoding>
            <transactionTimeliness></transactionTimeliness>
            <transactionAmounts>
                <transactionShares>
                    <value>1000000</value>
                </transactionShares>
                <transactionPricePerShare>
                    <value>75.45</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>4966675</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>See footnote</value>
                    <footnoteId id="F2"/>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <footnotes>
        <footnote id="F1">The transaction reported herein was effected for the purpose of rebalancing the holdings of funds and accounts managed by JANA (as defined below).</footnote>
        <footnote id="F2">JANA Partners Management, LP (&quot;JANA&quot; or the &quot;Reporting Person&quot;) is a private money management firm which beneficially owns the securities reported herein through various accounts under its management and control. JANA Partners Management GP, LLC (the &quot;GP&quot;) is the general partner of JANA. Barry Rosenstein is the Founder of the GP and JANA. JANA, the GP and Barry Rosenstein disclaim any beneficial ownership of any of the Issuer's securities reported herein except to the extent of their pecuniary interest therein, if any.</footnote>
    </footnotes>

    <remarks>The Reporting Person may be deemed to be a director by deputization for purposes of Section 16 under the Securities Exchange Act of 1934 by virtue of the fact that Scott Ostfeld, a Managing Partner and Portfolio Manager of the Reporting Person, currently serves on the board of directors of the Issuer.</remarks>

    <ownerSignature>
        <signatureName>/s/ JANA Partners Management, LP, by Jennifer Fanjiang, Partner, Chief Legal Officer and Chief Compliance Officer</signatureName>
        <signatureDate>2025-11-10</signatureDate>
    </ownerSignature>
</ownershipDocument>
