EXHIBIT 4(A) HARLEYSVILLE GROUP INC. AGENCY STOCK PURCHASE PLAN As Amended & Restated June 7, 2005 1.Purpose The Harleysville Group Inc. Agency Stock Purchase Plan (the "Plan") is established by the Harleysville Group Inc. (the "Company") for the benefit of the independent insurance agencies of the Company's parent, Harleysville Mutual Insurance Company ("Parent"), and the Company's affiliated and subsidiary insurance companies, which shall be those insurance companies 50% or more of whose stock is owned by the Company or Parent. This Plan provides an Eligible Agency and its Key Employees, as defined below, an opportunity to acquire a long-term proprietary interest in the Company through the purchase of the Company stock at a discount from fair market value. In offering this Plan, the Company seeks to foster the common interests of the Company and its independent agencies and employees thereof in achieving long-term profitable growth for the Company. Accordingly, the Company has created this Plan for the purpose of facilitating the purchase of and long-term holding of shares of its stock by an Eligible Agency and its Key Employees and not for such Agency's or Key Employee's short-term gain. It is expected that an Eligible Agency or Key Employee thereof that purchases shares of stock hereunder will hold such shares on a long-term basis, as the Plan is not intended to benefit an agency or employee which demonstrates a pattern of immediate resale of shares acquired hereunder and, as discussed in Paragraph 2 below regarding eligibility, such a pattern of conduct will cause an otherwise Eligible Agency to become ineligible for continued participation in the Plan. Page 35 2.Eligibility (a)An agency designated as an Eligible Agency by the Company is eligible to participate in this Plan. An Eligible Agency shall be an agency which, as determined by the Company in its discretion, is an agency that brings value to the Company, its Parent, affiliates and subsidiaries and with which the Company seeks a long term relationship. The Company, in its discretion, may base eligibility on agency segmentation class or any other factor(s) which indicates value to the Company or Parent, directly or indirectly. Continued eligibility will be subject to the Company's periodic review. (b)An Eligible Agency that participates in this Plan may direct that shares purchased under this Plan from its contribution account, as defined below, be registered as of the date of purchase in the name of certain persons associated with the agency. Such persons shall only be (i) the principal or principals of an Eligible Agency that is a proprietorship, (ii) the general partner or general partners of an Eligible Agency that is a partnership, (iii) the officers and stockholders of an Eligible Agency that is a corporation, (iv) employee benefit plans of such entities established for the benefit of any of the foregoing persons, and (v) key employees designated by the principal or principals of an Eligible Agency that is a proprietorship, the general partner or general partners of an Eligible Agency that is a partnership, or the executive officers of an Eligible Agency that is a corporation. The Company's determination of which individuals are eligible for direct registration under this Plan will be final, conclusive and binding. All persons enumerated in (i) through (v) above who are designated by any such Eligible Agency to participate in the Plan are referred to herein as "Key Employees". Page 36 (c)A pattern of immediate resale of stock acquired under this plan by an Eligible Agency or a Key Employee thereof shall be a factor in the Company's determination of the Eligible Agency's continued eligibility for the Plan because it shows that an Eligible Agency and its Key Employees are not interested in sharing in the long term profitable growth of the Company. 3.Methods of Payment and Amount of Contribution There shall be three methods of payment to purchase stock. An Eligible Agency may elect any of the payment methods individually or in combination. In each Subscription Period an Eligible Agency may contribute an aggregate maximum of $12,500 toward the purchase of stock under all payment methods combined. (a)An Eligible Agency may elect to purchase stock through deductions from its semi-monthly direct bill commission payments. Under this method, an Eligible Agency shall designate no less than one percent (1%) and no more than ten percent (10%) of the Eligible Agency's direct bill commission payments, in whole number increments, to be withheld from the Eligible Agency's direct bill commission payments; provided, however, that no more than $12,500 per Subscription Period will be withheld by Company from direct bill commission payments. Direct bill commission payments shall mean the commissions earned and that are actually available for payment in a semi-monthly period to an Eligible Agency for personal and commercial direct bill policies after all offsetting debits and credits are applied as determined solely from the Company's records. Page 37 (b)An Eligible Agency may elect to purchase stock during each January 15th - July 14th Subscription Period through a deduction from the bonus, if any, payable to the Eligible Agency under the applicable Agency Contingency Plan or its equivalent. Under this method, an Eligible Agency shall designate a percentage of the bonus, in whole number increments, to be withheld by the Company subject to a maximum of $12,500. (c)An Eligible Agency may elect to purchase stock through lump sum payments to the Company. Under this method, the Eligible Agency shall pay to the Company by June 1st or December 1st a dollar amount in a lump sum. If an Eligible Agency is contributing under the direct bill commission payment method under subparagraph (a), the total amount of any lump sum payments shall not be less than $1,000 and not more than $12,500, or if an Eligible Agency is not enrolled under subparagraph (a), the total amount of any lump sum payments shall not be less than $1,000 and not more than $6,000. Page 38 At the end of each Subscription Period, each Eligible Agency's direct bill commission payments, if any, shall be totaled and added to all lump sum and bonus payments, if any, made by such agency. Any excess over $12,500 shall be returned within a reasonable time to the Eligible Agency without interest. The amount remaining shall be applied to purchase stock as specified below. If at any time throughout a Subscription Period an Eligible Agency's total payments exceeds the maximum permitted for such agency, then upon request by the Eligible Agency such excess amount will be returned within a reasonable period to the Eligible Agency without interest. 4.Duration of Offer and Subscription Periods This Plan shall be in effect from July 15, 2005 through and including July 31, 2015. During the duration of the Plan there will be twenty (20) "Subscription Periods". Each Subscription Period runs from January 15th through July 14th or from July 15th through January 14th. 5.Enrollment and Enrollment Periods Enrollment for participation based on withholding from direct bill commissions will take place in the "Enrollment Period" which shall be from the 1st through 14th day of January and July of each year commencing with July of 2005. An Eligible Agency shall be sent a Subscription Agreement prior to the beginning of the Enrollment Period. An Eligible Agency that desires to subscribe for the purchase of stock through withholding from direct bill commissions for the following Subscription Period must file a Subscription Agreement during the applicable Enrollment Period. Once enrolled, an Eligible Agency will continue to participate in the Plan for each succeeding Subscription Period until it ceases to be an Eligible Agency or chooses to Page 39 withdraw from the Plan pursuant to Paragraph 9. If an Eligible Agency desires to change its rate of contribution it may do so effective for the next Subscription Period by filing a new Subscription Agreement during the Enrollment Period for that Subscription Period. An Eligible Agency that wishes to make lump sum purchases during a Subscription Period shall remit a lump sum to the Company along with a supplemental Subscription Agreement for that Subscription Period by June 1st or December 1st of the Subscription Period. An Eligible Agency that wishes to make a purchase during the January 15th - July 14th Subscription Period through designation of a portion of its bonus under the Agency Contingency Plan shall file a Subscription Agreement during the Enrollment Period for that Subscription Period. 6.Number of Shares to be Offered The aggregate number of shares of common stock that may be issued under the Plan is 1,000 shares which were registered subsequent to the adoption and approval of the Agency Stock Purchase Plan as restated on August 23, 1995. The total number of shares to be made available under the Plan is 500,000 shares of capital stock of the Company ("Stock"). In the event these registered shares of Stock are subscribed prior to the expiration of the Plan, the Plan may be terminated in accordance with Section 14 of the Plan. 7.Subscription Price The "Subscription Price" for each share of Stock shall be ninety percent (90%) of the fair market value of such share on the last day of the Subscription Period provided, however, that the price shall never be less than $1.00 per share which is the par value of a share of Company Stock. The fair market value of a share shall be the closing price as of the last day of the Subscription Period on which a trade occurs as reported on the NASDAQ National Market System. Page 40 8.Purchase of Shares The Company will maintain a contribution account in the name of each enrolled Eligible Agency. As of the last day of each Subscription Period, the total amount deducted from the Eligible Agency's direct bill commission, any bonus withholding, and any lump sum payments, not to exceed $12,500 from all three sources, will be credited to the Eligible Agency's contribution account. At such time, the amount then so credited will be divided by the Subscription Price for such Subscription Period. The full amount of shares, including fractional shares, which results will then be allocated to the accounts maintained on the books of the Company's stock transfer agent ("Plan Accounts") for the Eligible Agency and its Key Employees in accordance with the allocations specified in the most current form regarding stock registration filed with the Company by the Eligible Agency. The Company shall be entitled to rely on the most recent form regarding stock registration executed in accordance with rules and procedures established by the Committee, and the Company shall have no liability for allocation of shares consistent with such form. Shares will be issued in book entry form with the Company's stock transfer agent and titled in the name of the enrolled Eligible Agency, or Key Employee, as the case may be. An enrolled Eligible Agency and its Key Employees will receive a statement of account in a timely fashion following the end of each Subscription Period in which shares are acquired. In the event the number of shares subscribed for any Subscription Period exceeds the number of shares available for sale under the Plan for such period, the available shares shall be allocated among all the Eligible Agencies in proportion to their Plan Account balances. Page 41 9.Withdrawal from the Plan An enrolled Eligible Agency may withdraw from the Plan at any time prior to the end of a Subscription Period. At the time of withdrawal the amount of cash credited to the Eligible Agency's Plan Account for that Subscription Period will be refunded in cash without interest. If an Eligible Agency withdraws, such Eligible Agency may not resubscribe until after the next full Subscription Period has elapsed. 10.Special Rules for Section 16 Officers and 5% Owners An agency which would otherwise be an Eligible Agency may not participate in this Plan if the agency is subject to Section 16 of the Securities Exchange Act of 1934 in connection with the Company or is a 5% owner of the Company as defined under Section 13 of said Act. If an Eligible Agency is enrolled in the Plan and becomes subject to Section 16 or a 5% owner, then such Eligible Agency will be deemed to have withdrawn from the Plan and all amounts credited will be refunded in cash. 11.Termination of Agency Status Termination of agency status for any reason shall be treated as an automatic withdrawal as set forth in Section 9. 12.Assignment and Issuance of Shares No Eligible Agency may assign its subscription or rights to subscribe to any other entity (including its shareholders or partners) and any attempted assignment shall be void. All shares issued under this Plan shall be titled in the name of the Eligible Agency. Notwithstanding the foregoing, an Eligible Agency may permit direct registration of stock in the name of a Key Employee as described in paragraph 8 hereof. Page 42 13.Adjustment of and Changes in the Stock In the event that the shares of Stock shall be changed into or exchanged for a different number or kind of shares of stock or other securities of the Company or of another corporation (whether by reason of merger, consolidation, recapitalization, split up, combination of shares, or otherwise), or if the number of shares of Stock shall be increased through a stock split or the payment of a stock dividend, then there shall be substituted for or added to each share of Stock theretofore reserved for sale under the Plan, the number and kind of shares of stock or other securities into which each outstanding share of Stock shall be so changed, or for which each such share shall be exchanged, or to which each such share shall be entitled, as the case may be. 14.Amendment or Discontinuance of the Plan The Board of Directors of the Company shall have the right to amend, modify or terminate the Plan at any time without notice provided that no participant's existing rights are adversely affected thereby. 15.Administration The Plan shall be administered by a committee to be appointed by the Board of Directors consisting of three employees of the Company. The committee may from time to time adopt rules, regulations and procedures for carrying out the Plan. Interpretation or construction of any provision of the Plan by the committee shall be final and conclusive on all persons absent contrary action by the Board of Directors. 16.Titles Page 42 Titles are provided herein for convenience only and are not to serve as a basis for interpretation or construction of this Agreement. 17.Applicable Law The Plan shall be construed, administered and governed in all respects under the laws of the Commonwealth of Pennsylvania. EXHIBIT 4A