<PAGE>
                                                                    EXHIBIT 10.5
                              ASSIGNMENT AGREEMENT

                                                         Date: July 3, 2002

To:      COMERICA BANK, in its capacity as Agent ("Agent")

Re:      Credit Agreement dated as of August 3, 1999 (as amended or otherwise
         modified from time to time, the "Credit Agreement") by and among the
         lenders from time to time parties thereto (collectively, the "Banks"),
         Comerica Bank, as Agent for the Banks (the "Agent"), and Meadowbrook
         Insurance Group, Inc.
         (the "Company")

Ladies and Gentlemen:

         Reference is made to Sections 13.8 (c) and (d) of the Credit Agreement.
Unless otherwise defined herein or the context otherwise requires, all initially
capitalized terms used herein without definition shall have the meanings
specified in the Credit Agreement.

         This Agreement constitutes notice to each of you of the proposed
assignment and delegation by Bank One, a Michigan banking corporation (the
"Assignor") to Comerica Bank, a Michigan banking corporation (the "Assignee"),
and the Assignor hereby sells and assigns to the Assignee, and the Assignee
hereby purchases and assumes from the Assignor, as of the Effective Date (as
defined below), a one hundred percent (100%) undivided interest in each of
Assignor's rights and obligations under the Credit Agreement, its Notes
(including any participations in any outstanding Letters of Credit) and the
other Loan Documents such that, after giving effect to the foregoing assignment
and assumption, (i) the Assignor's interest in the Revolving Credit shall equal
Zero Dollars ($0) and the Assignor's Percentage shall equal zero percent (0%),
and (ii) Assignor shall not be a Bank under, or a signatory to, the Credit
Agreement.

         The Assignor hereby instructs the Agent to make all payments from and
including the Effective Date hereof in respect of the interest assigned hereby,
directly to the Assignee. The Assignor and the Assignee agree that all interest
and fees accrued up to, but not including, the Effective Date of the assignment
and delegation being made hereby are the property of the Assignor, and not the
Assignee. The Assignee agrees that, upon receipt of any such interest or fees
accrued up to the Effective Date, or any other payments in respect of the
interest assigned hereby applicable to the period prior to the Effective Date,
the Assignee will promptly remit the same to the Assignor in the same funds
received by the Assignee.

         The Assignor and the Assignee agree that all interest and fees accruing
from and after the Effective Date of the assignment and delegation being made
hereby are the property of the Assignee, and not the Assignor. The Assignor
agrees that, upon receipt of any such interest or fees accruing from and after
the Effective Date or any other payments in respect of the interest assigned
hereby applicable to the period from and after the Effective Date, the Assignor
will promptly remit the same to the Assignee in the same funds received by the
Assignor.

         The Assignee hereby confirms that it has received a copy of the Credit
Agreement and the exhibits and schedules referred to therein, and all other Loan
Documents which it considers necessary, together with copies of the other
documents which were required to be delivered



<PAGE>



under the Credit Agreement as a condition to the making of the loans thereunder.
The Assignee acknowledges and agrees that it: (a) has made and will continue to
make such inquiries and has taken and will take such care on its own behalf as
would have been the case had its Commitment been granted and its loans been made
directly by such Assignee to the Company without the intervention of the Agent,
the Assignor or any other Bank; and (b) has made and will continue to make,
independently and without reliance upon the Agent, the Assignor or any other
Bank, and based on such documents and information as it has deemed appropriate,
its own credit analysis and decisions relating to the Credit Agreement. The
Assignee further acknowledges and agrees that neither the Agent, nor the
Assignor has made any representations or warranties about the creditworthiness
of the Company or any other party to the Credit Agreement or any other of the
Loan Documents, or with respect to the legality, validity, sufficiency or
enforceability of the Credit Agreement, or any other of the Loan Documents. This
assignment shall be made without recourse to or warranty by the Assignor, except
as set forth herein.

         Assignee represents and warrants that it is a Person to which
assignments are permitted pursuant to Sections 13.8(c) and (d) of the Credit
Agreement.

         Assignor represents and warrants, as of the Effective Date, that it is
the legal and beneficial owner of the interest being assigned and delegated by
it hereunder and that such interest is free and clear of any pledge, encumbrance
or other adverse claim or interest created by Assignor.

         Except as otherwise provided in the Credit Agreement, effective as of
the Effective Date:

         (a)      the Assignee: (i) shall be deemed automatically to have become
                  a party to the Credit Agreement and the other Loan Documents,
                  to have assumed all of the Assignor's obligations thereunder
                  to the extent of the Assignee's percentage referred to in the
                  second paragraph of this Assignment Agreement, and to have all
                  the rights and obligations of a party to the Credit Agreement
                  and the other Loan Documents, as if it were an original
                  signatory thereto to the extent specified in the second
                  paragraph hereof; and (ii) agrees to be bound by the terms and
                  conditions set forth in the Credit Agreement and the other
                  Loan Documents as if it were an original signatory thereto;
                  and

         (b)      the Assignor's obligations under the Credit Agreement and the
                  other Loan Documents shall be reduced, by the Percentage
                  referred to in the second paragraph of this Assignment
                  Agreement, and the Assignor shall not be a Bank under, or a
                  signatory to, the Credit Agreement.

         As used herein, the term "Effective Date" means the date on which all
of the following have occurred or have been completed, as reasonably determined
by the Agent:

         (1)      the delivery to the Agent of an original of this Assignment
                  Agreement executed by the Assignor and the Assignee;

         (2)      the payment to the Agent, of all accrued fees, expenses and
                  other items for which reimbursement is then owing under the
                  Credit Agreement;


<PAGE>

         (3)      all other restrictions and items noted in Sections 138(c) and
                  (d) of the Credit Agreement have been completed;

         (4)      Delivery by the Assignor to the Assignee of the original of
                  each note held by the Assignor under the Credit Agreement.

         On the Effective Date the Assignee shall pay to the Assignor an amount
equal to $10,710,865.59 (the "Payoff Amount"). Assignee, Assignor and Agent each
acknowledge and agree that the Payoff Amount constitutes the total amount
payable to Assignor in connection with Assignee's purchase of all principal,
interest, fees and other amounts of indebtedness owed to Assignor, and upon
receipt of the Payoff Amount the Assignor shall not be a Bank under, or a
signatory to, the Credit Agreement.

         The Agent shall notify the Assignor and the Assignee, along with
Company, of the Effective Date.

         The Assignor has delivered to the Agent (or is delivering to Agent
concurrently herewith), the original of each Note held by the Assignor under the
Credit Agreement.



<PAGE>


         Please evidence your consent to and acceptance of the proposed
assignment and delegation set forth herein by signing and returning counterparts
hereof to the Assignor and the Assignee.

                             BANK ONE, as Assignor


                             By:  Michele L. Quinten
                                --------------------------------------

                             Its: A- Vice President
                                 -------------------------------------


                             COMERICA BANK, as Assignee


                             By:  Jatinder Kalia
                                --------------------------------------

                             Its: Director, Corporate Finance
                                 -------------------------------------

ACCEPTED AND CONSENTED TO
this   2nd   day of July, 2002
     -------
COMERICA BANK, as Agent           MEADOWBROOK INSURANCE GROUP, INC., as Company


By:  Jatinder Kalia               By:  Joseph C. Henry
   -----------------------------     ------------------------------------------

Its: Director, Corporate Finance  Its: Executive Vice President
    ----------------------------      -----------------------------------------