<PAGE>

                                                                    EXHIBIT 10.4

     STOCK REPURCHASE AGREEMENT dated as of September 30, 1997, by and between
MIL 3, INCORPORATED (the "Company"), a Delaware corporation, and MARC A. COHEN
(the "Shareholder"), an individual residing in the District of Columbia.


                                  WITNESSETH:

     WHEREAS,  Summit Ventures IV, L.P. and Summit Investors III, L.P. (together
the "Investors") and the Company have entered into a Series A Preferred Stock
Purchase Agreement (the "Series A Purchase Agreement") contemplating the sale by
the Company to the Investors of a total of 144,640 shares of the Company's newly
authorized Series A Preferred Stock (the "Series A Preferred Stock"), at a price
of $48.40 per share; and

     WHEREAS, the Shareholder desires to sell to the Company, and the Company
desires to repurchase from the Shareholder, 20,833 shares (the "Common Shares")
of the Company's common stock, par value $.01 per share, owned by the
Shareholder, at a price of $48.40 per Common Share, or an aggregate of
$1,008,317 (the "Repurchase Price").

     NOW, THEREFORE, in consideration of the foregoing and the mutual promises
set forth herein, the parties hereto, intending legally to be bound hereby,
agree as follows:

     1.  Notice of Repurchase.  Not later than one business day following
         ---------------------
consummation by the Company of the sale of the Series A Preferred Stock to the
Investors in accordance with the Series A Purchase Agreement (the "Series A
Closing"), the Company shall provide written notice (the "Tender Notice") to the
Shareholder of the date (the "Closing Date") on which the Company will
repurchase the Common Shares.

     2.  Closing.
         --------

          (a)  Following receipt by the Shareholder of the Tender Notice, the
Shareholder shall, on or before the Closing Date, deliver to the Company at its
offices specified in Section 5 below, one or more certificates evidencing the
Common Shares, accompanied by one or more undated stock transfers duly executed
in blank by the Shareholder.

          (b)  Subject to (i) consummation of the Series A Closing  and (ii)
compliance by the Shareholder with the terms and conditions herein, on the
Closing Date, the Company shall repurchase the Common Shares for the Repurchase
Price, which shall be paid by check drawn in the name of the Shareholder.

     3.  Representations.  The Shareholder represents and warrants that (a) he
         ----------------
is the sole and exclusive legal and beneficial owner of the Common Shares, free
and clear of all liens, claims and encumbrances (collectively, the "Liens"),
other than any such Lien that may exist in favor of the Company, (b) he has full
right, power and authority to sell, transfer and convey the Common
<PAGE>

Shares to the Company as contemplated hereby, and (c) he is familiar with the
business and affairs of the Company and has had an opportunity to ask questions
of, and receive answers from, the Company's management concerning the terms and
conditions of this Agreement, the Series A Purchase Agreement, and the Company.

     4.   Survival; Limitation of Liability.  The Shareholder's representations
          ----------------------------------
and warranties in Section 3 shall survive the execution and delivery of this
Agreement and the closing of the sale and repurchase of the Common Shares
contemplated hereby, and shall terminate on the first anniversary of the Closing
Date. Notwithstanding anything to the contrary herein, the liability of the
Shareholder for any breach of his representations and warranties shall not
exceed the Repurchase Price.

     5.   Notices.  All notices or other communications required or permitted to
          --------
be delivered hereunder shall be in writing signed by the party giving the notice
and sent by express delivery service, or regular or certified mail, addressed as
follows:

               If to the Company:

                    MIL 3, Incorporated
                    3400 International Drive, N.W.
                    Washington, D.C. 20008
                    Attn:  Marc A. Cohen, Chairman
                      and Chief Executive Officer

               If to the Shareholder:

                    Marc A. Cohen
                    c/o MIL 3, Incorporated
                    3400 International Drive, N.W.
                    Washington, D.C. 20008
                    Attn:  Marc J. Cohen, Chairman
                      and Chief Executive Officer

     Notices given in accordance with the foregoing shall be deemed received (i)
upon receipt, if hand delivered, and (ii) five business days after deposited in
the U.S. mail, if sent by mail.

     6.   Entire Agreement. This Agreement shall constitute the entire agreement
          ----------------
of the parties with respect to the matters contemplated herein. This Agreement
supersedes any and all prior understandings as to the subject matter of this
Agreement.

     7.   Amendments, Waivers and Consents.  Any provision in this Agreement to
          --------------------------------
the contrary notwithstanding, changes in or additions to this Agreement may be
made, and compliance

                                       2
<PAGE>

with any covenant or provision herein may be omitted or waived, only by a
writing signed by the parties.

     8.   Binding Effect; Assignment.  This Agreement shall be binding upon and
          --------------------------
inure to the benefit of the successors and assigns of the parties hereto.

     9.   General; Definitions. The headings contained in this Agreement are for
          --------------------
reference purposes only and shall not in any way affect the meaning or
interpretation of this Agreement. In this Agreement the singular includes the
plural, the plural the singular, and the masculine gender includes the neuter,
masculine and feminine genders.

     10.  Severability.  If any provision of this Agreement shall be found by
          ------------
any court of competent jurisdiction to be invalid or unenforceable, the parties
hereby waive such provision to the extent that it is found to be invalid or
unenforceable.  Such provision shall, to the maximum extent allowable by law, be
modified by such court so that it becomes enforceable, and, as modified, shall
be enforced as any other provision hereof, with all the other provisions hereof
continuing in full force and effect.

     11.  Counterparts.  This Agreement may be executed in counterparts, each of
          ------------
which shall be considered an original and both of which together shall
constitute one and the same instrument.

     12.  Governing Law.  This Agreement shall be deemed a contract made under
          -------------
the laws of the State of New York and together with the rights and obligations
of the parties hereunder, shall be construed under and governed by the laws of
such State.

     13.  Third Party Beneficiaries. This Agreement is made for the benefit of
          -------------------------
the parties hereto and shall not confer any rights or benefits on any person not
a party hereto.


                           [Signatures on next page]

                                       3
<PAGE>

     IN WITNESS WHEREOF, the parties have caused this Agreement to be duly
executed and delivered as of the date for first above written.



                               MIL 3, INCORPORATED



                                By:  /s/   Alain Cohen
                                     -----------------------------
                                     Name:  Alain Cohen
                                     Title: President



                                     /s/   Marc A. Cohen
                                   -------------------------------
                                   MARC A. COHEN

                                       4