1

                                                                       Exhibit 5

                          [Letterhead of Shaw Pittman]

                                 August 16, 1999



American Management Systems, Incorporated
4050 Legato Road
Fairfax, Virginia  22033

Ladies and Gentlemen:

       We have acted as counsel to American Management Systems, Incorporated
(the "Company"), a Delaware corporation, in connection with the registration of
2,000,000 shares (the "Shares") of Common Stock, $0.01 par value per share, of
the Company pursuant to a Registration Statement on Form S-8 under the
Securities Act of 1933, as amended (the "Registration Statement") relating to
the Company's 1996 Amended Stock Option Plan F, as amended (the "Plan").

       Based upon examination and review of (i) the Second Restated Certificate
of Incorporation of the Company, as amended, (ii) the Bylaws of the Company, as
amended, (iii) the resolutions of the Board of Directors of the Company dated
March 3, 1999, and (iv) the Plan, we are of the opinion that the Shares have
been duly authorized for issuance by the Company, and that upon issuance and
delivery in accordance with the Plan referred to in the Registration Statement,
the Common Stock will be validly issued, fully paid and nonassessable.

       Our opinions stated in this letter are based on the published
compilations of the General Corporation Law of the State of Delaware in effect
on the date of this letter. The opinions expressed in this letter are limited to
the matters set forth herein, and no other opinions should be inferred beyond
the matters expressly stated.

       We hereby consent to the filing of this opinion as an exhibit to the
Registration Statement.

                                        Very truly yours,

                                        /s/ SHAW PITTMAN

                                        SHAW PITTMAN