MID PENN BANK
                    EXECUTIVE DEFERRED COMPENSATION AGREEMENT

      THIS AGREEMENT is made this 24th day of July, 2002, by and between Mid
Penn Bank, a state commercial bank located in Millersburg, Pennsylvania (the
"Company"), and ALAN DAKEY (the "Executive").

                                  INTRODUCTION

      To encourage the Executive to remain an employee of the Company, the
Company is willing to provide to the Executive a deferred compensation
opportunity. The Company will pay the Executive's benefits from the Company's
general assets.

                                    AGREEMENT

      The Executive and the Company agree as follows:

                                    ARTICLE 1
                                   DEFINITIONS

      1.1 DEFINITIONS. Whenever used in this Agreement, the following words and
phrases shall have the meanings specified:

            1.1.1 "CHANGE OF CONTROL" shall mean any of the following:

                  (A) any person (as such term is used in Sections 13(d) and
      14(d)(2) of the Securities Exchange Act of 1934, as amended (the "Exchange
      Act"), other than the Corporation, a subsidiary of the Corporation, an
      employee benefit plan (or related trust) of the Corporation or a direct or
      indirect subsidiary of the Corporation, or affiliates of the Corporation
      (as defined in Rule 12b-2 under the Exchange Act), becomes the beneficial
      owner (as determined pursuant to Rule 13d-3 under the Exchange Act),
      directly or indirectly, of securities of the Corporation representing more
      than 20% of the

                                        2

<PAGE>

      combined voting power of the Corporation's then outstanding securities or
      announces a tender offer or exchange offer for securities of the
      Corporation representing more than 20% of the combined voting power of the
      Corporation's then outstanding securities; or

                  (B) the liquidation or dissolution of the Corporation or the
      Company or the occurrence of, or execution of an agreement providing for,
      a sale of all or substantially all of the assets of the Corporation or the
      Company to an entity which is not a direct or indirect subsidiary of the
      Corporation; or

                  (C) the occurrence of, or execution of an agreement providing
      for, a reorganization, merger, consolidation or other similar transaction
      or connected series of transactions of the Corporation as a result of
      which either (a) the Corporation does not survive or (b) pursuant to which
      shares of the Corporation common stock ("Common Stock") would be converted
      into cash, securities or other property, UNLESS, in case of either (a) or
      (b), the holders of Corporation Common Stock immediately prior to such
      transaction will, following the consummation of the transaction,
      beneficially own, directly or indirectly, more than 50% of the combined
      voting power of the then outstanding voting securities entitled to vote
      generally in the election of directors of the corporation surviving,
      continuing or resulting from such transaction; or

                  (D) the occurrence of, or execution of an agreement providing
      for, a reorganization, merger, consolidation, or similar transaction of
      the Corporation, or before any connected series of such transactions, if,
      upon consummation of such transaction or transactions, the persons who are
      members of the Board of Directors of the Corporation immediately before
      such transaction or transactions cease or, in the case of the execution of
      an agreement for such transaction or transactions, it is contemplated in
      such agreement that upon consummation such persons would cease, to
      constitute a majority of the Board of Directors of the Corporation or, in
      a case where the Corporation

                                        3

<PAGE>

      does not survive in such transaction, of the corporation surviving,
      continuing or resulting from such transaction or transactions; or

                  (E) any other event which is at any time designated as a
        "Change of Control" for purposes of this Agreement by a resolution
        adopted by the Board of Directors of the Corporation with the
        affirmative vote of a majority of the non-employee directors in office
        at the time the resolution is adopted; in the event any such resolution
        is adopted, the Change of Control event specified thereby shall be
        deemed incorporated herein by reference and thereafter may not be
        amended, modified or revoked without the written agreement of Executive.

            Notwithstanding anything else to the contrary set forth in this
      Agreement, if (i) an agreement is executed by the Corporation or the
      Company providing for any of the transactions or events constituting a
      Change of Control as defined herein, and the agreement subsequently
      expires or is terminated without the transaction or event being
      consummated, and (ii) Director's membership on the Company's Board did not
      terminate during the period after the agreement and prior to such
      expiration or termination, for purposes of this Agreement it shall be as
      though such agreement was never executed and no Change of Control event
      shall be deemed to have occurred as a result of the execution of such
      agreement.

            1.1.2 "CODE" means the Internal Revenue Code of 1986, as amended.

            1.1.3 "COMPENSATION" means the total salary and bonus paid to the
      Executive during a Plan Year.

            1.1.4 "CORPORATION" means Mid Penn Bancorp, Inc.

            1.1.5 "DISABILITY" means the Executive's suffering a sickness,
      accident or injury which has been determined by the carrier of any
      individual or group disability insurance

                                        4

<PAGE>

      policy covering the Executive, or by the Social Security Administration,
      to be a disability rendering the Executive totally and permanently
      disabled. The Executive must submit proof to the Company of the carrier's
      or Social Security Administration's determination upon the request of the
      Company.

            1.1.6 "ELECTION FORM" means the Form attached as Exhibit A.

            1.1.7 "DEFERRALS" means the amount of the Executive's Compensation,
      which the Executive elects to defer according to this Agreement.

            1.1.8 "NORMAL BENEFIT AGE" means the Executive's 62nd birthday.

            1.1.9 "NORMAL BENEFIT DATE" means the later of the Normal Benefit
      Age or the Executive's Termination of Employment.

            1.1.10 "TERMINATION OF EMPLOYMENT" means that the Executive ceases
      to be employed by the Company for any reason, voluntary or involuntary,
      other than by reason of a leave of absence approved by the Company.

                                    ARTICLE 2
                                DEFERRAL ELECTION

      2.1 INITIAL ELECTION. The Executive shall make an initial deferral
election under this Agreement by filing with the Company a signed Election Form
within 30 days after the Effective Date of this Agreement. The Election Form
shall set forth the amount of Compensation to be deferred and shall be effective
to defer only Compensation earned after the date the Election Form is received
by the Company.

      2.2 ELECTION CHANGES

                                        5

<PAGE>

            2.2.1 GENERALLY. UPON THE COMPANY'S APPROVAL, the Executive may
      modify the amount of Compensation to be deferred annually by filing a new
      Election Form with the Company prior to the beginning of the Plan Year in
      which the Compensation is to be deferred. The modified deferral election
      shall not be effective until the calendar year following the year in which
      the subsequent Election Form is received and approved by the Company.

            2.2.2 HARDSHIP. If an unforeseeable financial emergency arising from
      the death of a family member, divorce, sickness, injury, catastrophe or
      similar event outside the control of the Executive occurs, the Executive,
      by written instructions to the Company, may reduce future deferrals under
      this Agreement.

                                    ARTICLE 3
                                DEFERRAL ACCOUNT

      3.1 ESTABLISHING AND CREDITING. The Company shall establish a Deferral
Account on its books for the Executive, and shall credit to the Deferral Account
the following amounts:

            3.1.1 DEFERRALS. The Compensation deferred by the Executive as of
      the time the Compensation would have otherwise been paid to the Executive.

            3.1.2 INTEREST. Interest is to be compounded semi-annually on the
      account balance using an annual rate equal to 8%.

      3.2 STATEMENT OF ACCOUNTS. The Company shall provide to the Executive,
within one hundred twenty (120) days after each anniversary of this Agreement, a
statement setting forth the Deferral Account balance.

      3.3 ACCOUNTING DEVICE ONLY. The Deferral Account is solely a device for
measuring amounts to be paid under this Agreement. The Deferral Account is not a
trust fund of any kind. The Executive is a general unsecured creditor of the
Company for the payment of benefits. The benefits represent the mere Company
promise to pay such benefits. The

                                        6

<PAGE>

Executive's rights are not subject in any manner to anticipation, alienation,
sale, transfer, assignment, pledge, encumbrance, attachment, or garnishment by
the Executive's creditors.

                                    ARTICLE 4
                                LIFETIME BENEFITS

      4.1 NORMAL TERMINATION BENEFIT. Upon the Executive's Normal Benefit Date,
the Company shall pay to the Executive the benefit described in this Section 4.1
in lieu of any other benefit under this Agreement.

            4.1.1 AMOUNT OF BENEFIT. The benefit under this Section 4.1 is the
      Deferral Account balance at the Executive's Termination of Employment.

            4.1.2 PAYMENT OF BENEFIT. The Company shall pay the benefit to the
      Executive [OPTION 1] in a lump sum [OPTION 2] in equal monthly
      installments over 10 years commencing on the first day of the month
      following the Executive's Normal Benefit Date. The Company shall amortize
      the Deferral Account balance using the interest rate described in Section
      3.1.2.

      4.2 EARLY TERMINATION BENEFIT. If the Executive terminates Employment as
an Executive before the Normal Benefit Age for reasons other than death or
Disability, the Company shall pay to the Executive the benefit described in this
Section 4.2. in lieu of any other benefit under this Agreement.

            4.2.1 AMOUNT OF BENEFIT. The benefit under this Section 4.2 is
      Deferral Account balance at the Executive's Normal Benefit Age. Interest
      shall be credited to the account between the Executive's date of
      Termination of Employment and his Normal Benefit Age as specified in
      Section 3.1.2.

            4.2.2 PAYMENT OF BENEFIT. The Company shall pay the benefit to the
      Executive

                                        7

<PAGE>

      [OPTION 1] in a lump sum [OPTION 2] in equal monthly installments over 10
      years commencing on the first day of the month following the Executive's
      Normal Benefit Age. The Company shall continue to credit interest as
      described in Section 3.1.2 on the balance of the Deferral Account until
      all payments have been distributed.

      4.3 DISABILITY BENEFIT. Upon Termination of Employment for Disability
prior to the Normal Benefit Age, the Company shall pay to the Executive the
benefit described in this Section 4.3 in lieu of any other benefit under this
Agreement.

            4.3.1 AMOUNT OF BENEFIT. The benefit under this Section 4.3 is the
      Deferral Account balance at the Executive's Termination of Employment.

            4.3.2 PAYMENT OF BENEFIT. The Company shall pay the benefit to the
      Executive [OPTION 1] in a lump sum [OPTION 2] in equal monthly
      installments over 15 years commencing on the first day of the month
      following the Executive's Termination of Employment. The Company shall
      continue to credit interest as described in Section 3.1.2 on the balance
      of the Deferral Account until all payments have been distributed.

      4.4 CHANGE OF CONTROL BENEFIT. Upon a Change of Control while the
Executive is in the active employment of the Company, the Company shall pay to
the Executive the benefit described in this Section 4.4 in lieu of any other
benefit under this Agreement.

            4.4.1 AMOUNT OF BENEFIT. The benefit under this Section 4.4 is the
      Deferral Account balance at the date of the Executive's Termination of
      Employment.

            4.4.2 PAYMENT OF BENEFIT. The Company shall pay the benefit to the
      Executive [OPTION 1] in a lump sum [OPTION 2] in equal monthly
      installments over 15 years commencing on the first day of the month
      following the Executive's Termination of Employment. The Company shall
      continue to credit interest as described in Section 3.1.2

                                        8

<PAGE>

      on the balance of the Deferral Account until all payments have been
      distributed.

      4.5 HARDSHIP DISTRIBUTION. Upon the Company's determination (following
petition by the Executive) that the Executive has suffered an unforeseeable
financial emergency as described in Section 2.2.2, the Company shall distribute
to the Executive all or a portion of the Deferral Account balance as determined
by the Company, but in no event shall the distribution be greater than is
necessary to relieve the financial hardship.

                                    ARTICLE 5
                                 DEATH BENEFITS

      5.1 DEATH PRIOR TO COMMENCEMENT OF BENEFIT PAYMENTS. If the Executive dies
prior to commencement of benefit payments, the Company shall pay to the
Executive's beneficiary the benefit described in this Section 5.1 in lieu of any
other benefit under this Agreement.

            5.1.1 AMOUNT OF BENEFIT. The benefit amount under Section 5.1 is the
      Deferral Account balance at the time of the Executive's death.

            5.1.2 PAYMENT OF BENEFIT. The Company shall pay the benefit to the
      beneficiary [OPTION 1] in a lump sum [OPTION 2] in equal monthly
      installments over 10 years commencing on the first day of the month
      following the Executive's death. The Company shall amortize the Deferral
      Account balance as described in 3.1.2.

      5.2 DEATH DURING BENEFIT PERIOD. If the Executive dies after benefit
payments have commenced under this Agreement but before receiving all such
payments, the Company shall pay the remaining benefits to the Executive's
beneficiary at the same time and in the same amounts they would have been paid
to the Executive had the Executive survived.

                                        9

<PAGE>

                                    ARTICLE 6
                                  BENEFICIARIES

      6.1 BENEFICIARY DESIGNATIONS. The Executive shall designate a beneficiary
by filing a written designation with the Company. The Executive may revoke or
modify the designation at any time by filing a new designation. However,
designations will only be effective if signed by the Executive and accepted by
the Company during the Executive's lifetime. The Executive's beneficiary
designation shall be deemed automatically revoked if the beneficiary predeceases
the Executive, or if the Executive names a spouse as beneficiary and the
marriage is subsequently dissolved. If the Executive dies without a valid
beneficiary designation, all payments shall be made to the Executive's estate.

      6.2 FACILITY OF PAYMENT. If a benefit is payable to a minor, to a person
declared incompetent, or to a person incapable of handling the disposition of
his or her property, the Company may pay such benefit to the guardian, legal
representative or person having the care or custody of such minor, incompetent
person or incapable person. The Company may require proof of incompetence,
minority or guardianship as it may deem appropriate prior to distribution of the
benefit. Such distribution shall completely discharge the Company from all
liability with respect to such benefit.

                                    ARTICLE 7
                               GENERAL LIMITATIONS

      In lieu of any other benefit under this Agreement, the Company shall pay
the Executive (or his beneficiary if applicable) the Executive's Deferral
Account Balance in a lump sum within 60 days following Executive's Termination
of Employment under the following conditions:

      7.1 TERMINATION FOR CAUSE. If the Company terminates the Executive's
employment as a Executive for:

                                       10

<PAGE>

            7.1.1 Gross negligence or gross neglect of duties;

            7.1.2 Commission of a felony or of a gross misdemeanor involving
      moral turpitude; or

            7.1.3 Fraud, disloyalty, dishonesty or willful violation of any law
      or significant Company policy committed in connection with the Executive's
      Employment and resulting in an adverse financial effect on the Company.

      7.2 SUICIDE. If the Executive commits suicide within two years after the
date of this Agreement, or if the Executive has made any material misstatement
of fact on any application for life insurance purchased by the Company.

                                    ARTICLE 8
                          CLAIMS AND REVIEW PROCEDURES

      8.1 CLAIMS PROCEDURE. A Participant or beneficiary ("claimant") who has
not received benefits under the Plan that he or she believes should be paid
shall make a claim for such benefits as follows:

            8.1.1 INITIATION - WRITTEN CLAIM. The claimant initiates a claim by
      submitting to the Company a written claim for the benefits.

            8.1.2 TIMING OF COMPANY RESPONSE. The Company shall respond to such
      claimant within 90 days after receiving the claim. If the Company
      determines that special circumstances require additional time for
      processing the claim, the Company can extend the response period by an
      additional 90 days by notifying the claimant in writing, prior to the end
      of the initial 90-day period, that an additional period is required. The
      notice of extension must set forth the special circumstances and the date
      by which the Company expects to render its decision.

                                       11

<PAGE>

            8.1.3 NOTICE OF DECISION. If the Company denies part or all of the
      claim, the Company shall notify the claimant in writing of such denial.
      The Company shall write the notification in a manner calculated to be
      understood by the claimant. The notification shall set forth:

                  (a)   The specific reasons for the denial,

                  (b)   A reference to the specific provisions of the Plan on
                        which the denial is based,

                  (c)   A description of any additional information or material
                        necessary for the claimant to perfect the claim and an
                        explanation of why it is needed,

                  (d)   An explanation of the Plan's review procedures and the
                        time limits applicable to such procedures, and

                  (e)   A statement of the claimant's right to bring a civil
                        action under ERISA Section 502(a) following an adverse
                        benefit determination on review.

      8.2 REVIEW PROCEDURE. If the Company denies part or all of the claim, the
claimant shall have the opportunity for a full and fair review by the Company of
the denial, as follows:

            8.2.1 INITIATION - WRITTEN REQUEST. To initiate the review, the
      claimant, within 60 days after receiving the Company's notice of denial,
      must file with the Company a written request for review.

            8.2.2 ADDITIONAL SUBMISSIONS - INFORMATION ACCESS. The claimant
      shall then have the opportunity to submit written comments, documents,
      records and other information relating to the claim. The Company shall
      also provide the claimant, upon request and free of charge, reasonable
      access to, and copies of, all documents, records and other information
      relevant (as defined in applicable ERISA regulations) to the claimant's
      claim for benefits.

            8.2.3 CONSIDERATIONS ON REVIEW. In considering the review, the
      Company shall take into account all materials and information the claimant
      submits relating to the claim,

                                       12

<PAGE>

      without regard to whether such information was submitted or considered in
      the initial benefit determination.

            8.2.4 TIMING OF COMPANY RESPONSE. The Company shall respond in
      writing to such claimant within 60 days after receiving the request for
      review. If the Company determines that special circumstances require
      additional time for processing the claim, the Company can extend the
      response period by an additional 60 days by notifying the claimant in
      writing, prior to the end of the initial 60-day period, that an additional
      period is required. The notice of extension must set forth the special
      circumstances and the date by which the Company expects to render its
      decision.

            8.2.5 NOTICE OF DECISION. The Company shall notify the claimant in
      writing of its decision on review. The Company shall write the
      notification in a manner calculated to be understood by the claimant. The
      notification shall set forth:

                  (a)   The specific reasons for the denial,

                  (b)   A reference to the specific provisions of the Plan on
                        which the denial is based,

                  (c)   A statement that the claimant is entitled to receive,
                        upon request and free of charge, reasonable access to,
                        and copies of, all documents, records and other
                        information relevant (as defined in applicable ERISA
                        regulations) to the claimant's claim for benefits, and

                  (d)   A statement of the claimant's right to bring a civil
                        action under ERISA Section 502(a).

                                    ARTICLE 9
                           AMENDMENTS AND TERMINATION

      This Agreement may be amended or terminated only by a written agreement
signed by the Company and the Executive.

                                   ARTICLE 10
                                  MISCELLANEOUS

      10.1 BINDING EFFECT. This Agreement shall bind the Executive and the
Company, and their beneficiaries, survivors, executors, administrators and
transferees.

                                       13

<PAGE>

      10.2 NO GUARANTEE OF EMPLOYMENT. This Agreement is not a contract for
employment. It does not give the Executive the right to remain an employee of
the Company, nor does it interfere with the Company's right to discharge the
Executive. It also does not require the Executive to remain an employee nor
interfere with the Executive's right to terminate employment at any time.

      10.3 NON-TRANSFERABILITY. Benefits under this Agreement cannot be sold,
transferred, assigned, pledged, attached or encumbered in any manner.

      10.4 TAX WITHHOLDING. The Company shall withhold any taxes that are
required to be withheld from the benefits provided under this Agreement.

      10.5 APPLICABLE LAW. The Agreement and all rights hereunder shall be
governed by the laws of the Commonwealth of Pennsylvania, except to the extent
preempted by the laws of the United States of America.

      10.6 UNFUNDED ARRANGEMENT. The Executive and beneficiary are general
unsecured creditors of the Company for the payment of benefits under this
Agreement. The benefits represent the mere promise by the Company to pay such
benefits. The rights to benefits are not subject in any manner to anticipation,
alienation, sale, transfer, assignment, pledge, encumbrance, attachment, or
garnishment by creditors. Any insurance on the Executive's life is a general
asset of the Company to which the Executive and beneficiary have no preferred or
secured claim.

      10.7 REORGANIZATION. The Company shall not merge or consolidate into or
with another company, or reorganize, or sell substantially all of its assets to
another company, firm, or person unless such succeeding or continuing company,
firm, or person agrees to assume and discharge the obligations of the Company
under this Agreement.

                                       14

<PAGE>

      10.8 ENTIRE AGREEMENT. This Agreement constitutes the entire agreement
between the Company and the Executive as to the subject matter hereof. No rights
are granted to the Executive by virtue of this Agreement other than those
specifically set forth herein.

      10.9 ADMINISTRATION. The Company shall have powers which are necessary to
administer this Agreement, including but not limited to:

            10.9.1 Interpreting the provisions of the Agreement;

            10.9.2 Establishing and revising the method of accounting for the
      Agreement;

            10.9.3 Maintaining a record of benefit payments; and

            10.9.4 Establishing rules and prescribing any forms necessary or
      desirable to administer the Agreement.

      IN WITNESS WHEREOF, the Executive and a duly authorized Company officer
have signed this Agreement.

EXECUTIVE:                                 COMPANY:

                                           MID PENN BANK

  /s/ Alan Dakey                           By /s/  [ILLEGIBLE]
----------------------                        -------------------------------
      Alan Dakey                              Title Director

      By execution hereof, Mid Penn Bancorp, Inc. consents to and agrees to be
bound by the terms and condition of this Agreement.

ATTEST:                                    CORPORATION:
                                           MID PENN BANCORP, INC.

/s/  [ILLEGIBLE]                           By /s/  [ILLEGIBLE]
----------------------                        -------------------------------
                                           Title
                                                 ----------------------------

                                       15

<PAGE>

                                    EXHIBIT A
                                  MID PENN BANK
                    EXECUTIVE DEFERRED COMPENSATION AGREEMENT

                                DEFERRAL ELECTION

I elect to defer my compensation received from the Company, as follows:

                  -------------------------------------------

                               AMOUNT OF DEFERRAL
                  -------------------------------------------

                  [INITIAL AND COMPLETE ONE]

                   [ ]     I elect to defer ________% of my
                           compensation each year (excluding
                           bonuses)

                   [ ]     I elect to defer ________% of my
                           compensation and bonuses each
                           year

                   [X]     I elect to defer $20000 per year

                   [ ]     I elect not to defer any of my
                           compensation

                  -------------------------------------------

I understand that I may change the amount and duration of my deferrals by filing
a new election form with the Company; provided, however, that any subsequent
election will not be effective until the calendar year following the year in
which the new election is received by the Company.

Signature     /s/ Alan Dakey
          -----------------------

Date 7-24-02

Accepted by the Company this 24th day of July, 2002.

By /s/  [ILLEGIBLE]
   ---------------------------
   Title Director

                                       16

<PAGE>

                             BENEFICIARY DESIGNATION

                                  MID PENN BANK
                    EXECUTIVE DEFERRED COMPENSATION AGREEMENT

I designate the following as beneficiary of benefits under the Executive
Deferred Compensation Agreement payable following my death:

Primary:         DIANA G. DAKEY

Contingent:       JANET DAKEY 50%
                  ERIC DAKEY  50%

NOTE: TO NAME A TRUST AS BENEFICIARY, PLEASE PROVIDE THE NAME OF THE TRUSTEE(S)
   AND THE EXACT NAME AND DATE OF THE TRUST AGREEMENT.

I understand that I may change these beneficiary designations by filing a new
written designation with the Company. I further understand that the designations
will be automatically revoked if the beneficiary predeceases me, or, if I have
named my spouse as beneficiary, in the event of the dissolution of our marriage.

Signature       /s/ Alan Dakey
          --------------------------

Date 7-24-02

Accepted by the Company this 24th day of July, 2002.

By /s/  [ILLEGIBLE]
   ---------------------------
Title
      ------------------------

                                       17