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

    <schemaVersion>X0306</schemaVersion>

    <documentType>4</documentType>

    <periodOfReport>2017-02-01</periodOfReport>

    <notSubjectToSection16>0</notSubjectToSection16>

    <issuer>
        <issuerCik>0000921547</issuerCik>
        <issuerName>HERITAGE OAKS BANCORP</issuerName>
        <issuerTradingSymbol>HEOP</issuerTradingSymbol>
    </issuer>

    <reportingOwner>
        <reportingOwnerId>
            <rptOwnerCik>0001084960</rptOwnerCik>
            <rptOwnerName>LAGOMARSINO SIMONE</rptOwnerName>
        </reportingOwnerId>
        <reportingOwnerAddress>
            <rptOwnerStreet1>1222 VINE STREET</rptOwnerStreet1>
            <rptOwnerStreet2></rptOwnerStreet2>
            <rptOwnerCity>PASO ROBLES</rptOwnerCity>
            <rptOwnerState>CA</rptOwnerState>
            <rptOwnerZipCode>93446</rptOwnerZipCode>
            <rptOwnerStateDescription></rptOwnerStateDescription>
        </reportingOwnerAddress>
        <reportingOwnerRelationship>
            <isDirector>1</isDirector>
            <isOfficer>1</isOfficer>
            <isTenPercentOwner>0</isTenPercentOwner>
            <isOther>0</isOther>
            <officerTitle>President / CEO</officerTitle>
            <otherText></otherText>
        </reportingOwnerRelationship>
    </reportingOwner>

    <nonDerivativeTable>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common stock</value>
            </securityTitle>
            <transactionDate>
                <value>2017-02-01</value>
            </transactionDate>
            <deemedExecutionDate></deemedExecutionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>A</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>7081</value>
                    <footnoteId id="F6"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>13.44</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>A</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>175337</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common Stock</value>
                <footnoteId id="F1"/>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>7081</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>Restricted stock - performance based</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common stock</value>
                <footnoteId id="F2"/>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>6165</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>Restricted stock - performance based</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common stock</value>
                <footnoteId id="F3"/>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>6706</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>Restricted stock</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
        <nonDerivativeHolding>
            <securityTitle>
                <value>Common stock</value>
                <footnoteId id="F4"/>
            </securityTitle>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>6165</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>Restricted stock</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeHolding>
        <nonDerivativeTransaction>
            <securityTitle>
                <value>Common stock</value>
                <footnoteId id="F5"/>
            </securityTitle>
            <transactionDate>
                <value>2017-02-01</value>
            </transactionDate>
            <deemedExecutionDate></deemedExecutionDate>
            <transactionCoding>
                <transactionFormType>4</transactionFormType>
                <transactionCode>D</transactionCode>
                <equitySwapInvolved>0</equitySwapInvolved>
            </transactionCoding>
            <transactionAmounts>
                <transactionShares>
                    <value>7081</value>
                    <footnoteId id="F6"/>
                </transactionShares>
                <transactionPricePerShare>
                    <value>13.44</value>
                </transactionPricePerShare>
                <transactionAcquiredDisposedCode>
                    <value>D</value>
                </transactionAcquiredDisposedCode>
            </transactionAmounts>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>0</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>I</value>
                </directOrIndirectOwnership>
                <natureOfOwnership>
                    <value>Restricted stock</value>
                </natureOfOwnership>
            </ownershipNature>
        </nonDerivativeTransaction>
    </nonDerivativeTable>

    <derivativeTable>
        <derivativeHolding>
            <securityTitle>
                <value>ISO stock option</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>7.65</value>
            </conversionOrExercisePrice>
            <exerciseDate>
                <value>2015-02-03</value>
            </exerciseDate>
            <expirationDate>
                <value>2024-02-03</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>39213</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>39213</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </derivativeHolding>
        <derivativeHolding>
            <securityTitle>
                <value>ISO stock option</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>7.84</value>
            </conversionOrExercisePrice>
            <exerciseDate>
                <value>2016-03-02</value>
            </exerciseDate>
            <expirationDate>
                <value>2025-03-02</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>25510</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>25510</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </derivativeHolding>
        <derivativeHolding>
            <securityTitle>
                <value>NQ stock option</value>
            </securityTitle>
            <conversionOrExercisePrice>
                <value>7.84</value>
            </conversionOrExercisePrice>
            <exerciseDate>
                <value>2016-03-02</value>
            </exerciseDate>
            <expirationDate>
                <value>2025-03-02</value>
            </expirationDate>
            <underlyingSecurity>
                <underlyingSecurityTitle>
                    <value>Common stock</value>
                </underlyingSecurityTitle>
                <underlyingSecurityShares>
                    <value>19078</value>
                </underlyingSecurityShares>
            </underlyingSecurity>
            <postTransactionAmounts>
                <sharesOwnedFollowingTransaction>
                    <value>19078</value>
                </sharesOwnedFollowingTransaction>
            </postTransactionAmounts>
            <ownershipNature>
                <directOrIndirectOwnership>
                    <value>D</value>
                </directOrIndirectOwnership>
            </ownershipNature>
        </derivativeHolding>
    </derivativeTable>

    <footnotes>
        <footnote id="F1">Performance-based Restricted Stock Award pursuant to the 2005 Equity Based Compensation Plan.  This award is subject to forfeiture.  This award vests 1/3 each year and vesting is dependent upon related performance conditions being achieved.  Initial award was on 2/1/2014.</footnote>
        <footnote id="F2">Performance-based Restricted Stock Award pursuant to the 2005 Equity Based Compensation Plan.  This award is subject to forfeiture.  This award vests 1/3 of the initial award per year contingent upon related performance conditions being achieved.  Initial award was on 3/2/2015.</footnote>
        <footnote id="F3">Restricted stock award pursuant to 2015 Equity Incentive Plan. This award is subject to forfeiture. The shares vest equally over a three year vesting schedule beginning April 1, 2017.</footnote>
        <footnote id="F4">Restricted stock award pursuant to 2005 Equity Based Compensation Plan. This award is subject to forfeiture. The shares vest equally over a three year vesting schedule beginning March 2, 2016.</footnote>
        <footnote id="F5">Restricted stock award pursuant to 2005 Equity Based Compensation Plan. This award is subject to forfeiture. The shares vest equally over a three year vesting schedule beginning February 1, 2015.</footnote>
        <footnote id="F6">Vesting of restricted stock award.  Change from indirect to direct beneficial ownership.  Taxes paid by executive.</footnote>
    </footnotes>

    <ownerSignature>
        <signatureName>Bryon Layes Attorney-in-fact for Simone Lagomarsino</signatureName>
        <signatureDate>2017-02-03</signatureDate>
    </ownerSignature>
</ownershipDocument>
