

                                                                     Exhibit 5.1
                                                                     -----------

                             CHOATE, HALL & STEWART
               A PARTNERSHIP INCLUDING PROFESSIONAL CORPORATIONS
                                 EXCHANGE PLACE
                                53 STATE STREET
                        BOSTON, MASSACHUSETTS 02109-2891
                            TELEPHONE (617) 248-5000
                            FACSIMILE (617) 248-4000
                                 TELEX 49615860


                                                 July 31, 1996

Pegasystems Inc.
101 Main Street
Cambridge, MA 02142

Gentlemen:

     This opinion is delivered to you in connection with the registration
statement on Form S-8 (the "Registration Statement") to be filed on July 31,
1996 by Pegasystems Inc. (the "Company") under the Securities Act of 1933, as
amended, for registration under said Act of 5,750,000 shares of common stock,
$.01 par value (the "Common Stock"), of the Company.

     We are familiar with the Company's Restated Articles of Organization, its
Restated By-Laws, and its corporate minute book, as well as the Registration
Statement. We have also examined such other documents, records and certificates
and made such further investigation as we have deemed necessary for the purposes
of this opinion.

     Based upon and subject to the foregoing, we are of the opinion that the
shares of Common Stock to be sold by the Company under its Amended and Restated
1994 Long-Term Incentive Plan, its 1996 Employee Stock Purchase Plan and its
1996 Non-Employee Director Stock Option Plan, as in effect on the date hereof,
when issued against receipt of the agreed purchase price therefor, will be
legally issued, fully paid and nonassessable.

     We understand that this opinion is to be used in connection with the
Registration Statement and consent to the filing of this opinion as an exhibit
to the Registration Statement and to all references to this Firm included
therein.

                                       Very truly yours,


                                       CHOATE, HALL & STEWART

ds1-281467

