<Page> EXHIBIT 5.1 BROWN, WINICK, GRAVES, GROSS, BASKERVILLE AND SCHOENEBAUM, P.L.C. <Table> ATTORNEYS AT LAW 666 GRAND AVENUE, SUITE 2000 Richard W. Baskerville Nancy S. Boyd Valerie D. Bandstra Patents and Trademarks DES MOINES, IOWA 50309-2510 Bruce Graves James L. Pray Alexander M. Johnson G. Brian Pingel Steven C. Schoenebaum Brenton D. Soderstrum James S. Niblock Camille L. Urban TELEPHONE: (515) 242-2400 Harold N. Schneebeck Michael D. Treinen Ann Holden Kendell FACSIMILE: (515) 283-0231 Paul D. Hietbrink Scott L. Long Rebecca A. Brommel William C. Brown Ronni F. Begleiter Kelly K. Helwig Richard K. Updegraff Miranda L. Hughes Mark E. Roth Washington, D.C. Office Paul E. Carey Duane P. Hagerty Tina R. Thompson Brian Kennedy URL: www.ialawyers.com Douglas E. Gross Kelly D. Hamborg Brian M. Green John D. Hunter William E. Hanigan Dustin D. Smith James H. Gilliam Mary A. Ericson Adam W. Jones Offices in: Robert D. Andeweg Barbara B. Burnett Catherine C. Cownie Of Counsel: West Des Moines, Iowa Alice Eastman Helle Michael J. Green Erick D. Prohs Marvin Winick Pella, Iowa Michael R. Blaser Michael A. Dee Laura N. Martino Washington, D.C. Thomas D. Johnson Danielle Dixon Smid Amy R. Piepmeier Christopher R. Sackett Deborah J. Schmudlach Sean P. Moore Brian P. Rickert Walter R. Brown (1921-2000) WRITER'S DIRECT DIAL NO. (515) 242-2473 WRITER'S E-MAIL ADDRESS hanigan@ialawyers.com </Table> December 10, 2004 The Board of Directors East Kansas Agri-Energy, L.L.C. P.O. Box 225 210 1/2 East 4th Avenue Garnett, KS 66032 RE: 2004 Registration Statement on Form SB-2 Dear Directors: In connection with the currently proposed registered offering of up to 9,091 membership units ("Membership Units") of East Kansas Agri-Energy, L.L.C. (the "Company"), we have made such legal examination and inquiries as we have deemed advisable or necessary for the purpose of rendering this opinion and have examined originals or copies of the following documents and corporate records: 1. The Company's Articles of Organization; 2. The Company's Amended and Restated Operating Agreement, as amended; 3. The Company's resolutions of the Board of Directors authorizing the issuance of units; and 4. The Company's Registration Statement on Form SB-2, as filed by East Kansas Agri-Energy, L.L.C. with the United States Securities and Exchange Commission on [date] In rendering our opinions, with the consent of the Company, we have relied upon: (i) the representations of the Company and other representatives as set forth in the aforementioned documents as to those factual matters that we were unable to ascertain ourselves; and (ii) certificates and assurances from public officials and the Company as we have deemed necessary for purposes of expressing the opinions expressed herein. We have not undertaken any independent investigation to determine or verify any information and representations made by the Company and its representatives in the foregoing documents or in such certificates, and we <Page> December 10, 2004 Page 2 have relied upon such information and representations in expressing our opinions. We have assumed in rendering these opinions that no person or party has taken any action inconsistent with the terms of the above-described documents or prohibited by law. We have confirmed that no attorney in this office who has provided legal services to the Company within the past six months has notice or knowledge of any misstatements or inaccuracies in the representation upon which we have relied. The opinions expressed herein shall be effective only as of the date of this opinion letter. The opinions set forth herein are based upon existing law and regulations, all of which are subject to change prospectively and retroactively. Our opinions are based on the facts and the above documents as they exist on the date of this letter, and we assume no obligation to revise or supplement such opinions as to future changes of law or fact. This opinion letter is limited to the matters stated herein and no opinions are to be implied or inferred beyond the matters expressly stated herein. Based on our examination and inquiry, we are of the opinion that the Membership Units will be validly issued, duly authorized, fully paid and non-assessable when issued and sold in the manner referred to in the Registration Statement and under the applicable subscription agreement(s), provided that the Registration Statement is effective. Very truly yours, William E. Hanigan