1 EXHIBIT 5.1 [BARACK, FERRAZZANO, KIRSCHBAUM & PERLMAN LETTERHEAD] August 8, 1996 UnionBancorp, Inc. 122 W. Madison Street Ottawa, Illinois 61350 Ladies and Gentlemen: We have acted as special counsel to UnionBancorp, Inc., a Delaware corporation (the "Company"), in connection with the proposed offering of 1,265,000 shares (including 165,000 shares available pursuant to an over-allotment option granted to the underwriter) of its common stock, $1.00 par value ("Common Shares"), and 1,265,000 Preferred Stock Purchase Rights ("Rights") attached to such Shares, pursuant to an initial public offering (the "Offering") as described in the Form S-1 Registration Statement to be filed with the Securities and Exchange Commission (the "SEC") on or about August 9, 1996 (the "Registration Statement"). Capitalized terms used, but not defined, herein shall have the meanings given such terms in the Registration Statement. You have requested our opinion concerning certain matters in connection with the Offering. We have made such legal and factual investigation as we deemed necessary for purposes of this opinion. In our investigation, we have assumed the genuineness of all signatures, the proper execution of all documents submitted to us as originals, the conformity to the original documents of all documents submitted to us as copies and the authenticity of the originals of such copies. In arriving at the opinions expressed below, we have reviewed and examined the following documents: a. the Restated Certificate of Incorporation of the Company filed with the Secretary of State of the State of Delaware on May 13, 1991, as amended on March 4, 1994 and July 29, 1996, and the Company's Bylaws; b. the Registration Statement, including the prospectus constituting a part thereof (the "Prospectus"); c. a form of share certificate representing the Common Shares approved by the Board; and d. the Rights Agreement (the "Rights Agreement") between the Company and Harris Trust and Savings Bank, as Rights Agent; and 2 BARACK, FERRAZZANO, KIRSCHBAUM & PERLMAN UnionBancorp, Inc. August 8, 1996 Page 2 e. resolutions of the board of directors of the Company (the "Board") relating to the Offering and the Rights Agreement. We call your attention to the fact that our firm only requires lawyers to be qualified to practice law in the State of Illinois and, in rendering the foregoing opinions, we express no opinion with respect to any laws relevant to this opinion other than the Securities Act of 1933, as amended, and the rules and regulations thereunder, the laws and regulations of the State of Illinois, the General Corporation Law of the State of Delaware and United States federal law. Based upon the foregoing, but assuming no responsibility for the accuracy or the completeness of the data supplied by the Company and subject to the qualifications, assumptions and limitations set forth herein, it is our opinion that: 1. The Company has been duly organized and is validly existing in good standing under the laws of the State of Delaware and has due corporate authority to carry on its business as it is presently conducted. 2. The Company is authorized to issue up to 10,000,000 Common Shares, of which 2,851,404 Common Shares have been issued and are presently outstanding prior to the Offering. 3. When the Registration Statement shall have been declared effective by order of the SEC and the Common Shares and the Rights attached thereto to be sold thereunder shall have been issued and sold upon the terms and conditions set forth in the Registration Statement, then such Common Shares and Rights will be legally issued, fully paid and non-assessable. We express no opinion with respect to any specific legal issues other than those explicitly addressed herein. We assume no obligation to advise you of any change in the foregoing subsequent to the date of this opinion (even though the change may affect the legal conclusions stated in this opinion letter). We hereby consent (i) to be named in the Registration Statement, and in the Prospectus, as attorneys who will pass upon the legality of the Common Shares to be sold thereunder and (ii) to the filing of this opinion as an Exhibit to the Registration Statement. Sincerely, BARACK, FERRAZZANO, KIRSCHBAUM & PERLMAN