<PAGE>


                                                                  EXHIBIT 10.5.1

                           PHASE FORWARD INCORPORATED
                       TERMINATION AND AMENDMENT AGREEMENT

         This Termination and Amendment Agreement is made as of June 4, 2004 by
and among Phase Forward Incorporated, a Delaware corporation (the "Company"),
and each stockholder of the Company executing the Counterpart Signature Page
attached hereto (each, a "Stockholder" and collectively, the "Stockholders").

         1. Termination of Stock Purchase Agreements. In connection with the
Company's initial public offering of common stock (the "IPO"), the following
agreements are hereby terminated, effective immediately prior to the closing of
the IPO provided the price in the IPO equals or exceeds $7.50 (and, after June
1, 2005, $11.36) per share (subject to appropriate adjustments for stock splits,
stock dividends, combinations and other similar recapitalizations affecting such
shares): (i) the Series A Convertible Preferred Stock Purchase Agreement dated
as of November 14, 1997, (ii) the Series B Convertible Preferred Stock Purchase
Agreement dated as of November 12, 1998, (iii) the Series C Convertible
Preferred Stock Purchase Agreement dated as of November 19, 1999, and (iv) the
Series D Convertible Preferred Stock Purchase Agreement dated as of December 27,
2001.

         2. Amendment of Rights Agreement. The Stockholders, on behalf of all
parties (other than Company) to the Fifth Amended and Restated Investors' Rights
Agreement, dated as of December 27, 2001, as amended to date (the "Rights
Agreement"), hereby amend the Rights Agreement as follows:

         (a)      the definition "Initial Public Offering" in Section 1, Article
                  I of the Rights Agreement is hereby deleted in its entirety
                  and replaced with the following definition: "Initial Public
                  Offering means the initial public offering of shares of Common
                  Stock pursuant to a Registration Statement at a price to the
                  public that equals or exceeds $7.50 (and, after June 1, 2005,
                  $11.36) per share (subject to appropriate adjustments for
                  stock splits, stock dividends, combinations and other similar
                  recapitalizations affecting such shares) resulting in gross
                  proceeds to the Company (net of all underwriting discounts and
                  commissions) of at least $20,000,000."; and

         (b)      the phrase "In connection with the Company's Initial Public
                  Offering" in Section 3, Article IV of the Rights Agreement is
                  hereby deleted in its entirety and replaced with the following
                  phrase: "In connection with any Initial Public Offering
                  occurring after June 1, 2005".

         3. Effectiveness.

                  (a) The provisions of Section 1 hereof shall become effective
         upon the execution of this Termination and Amendment Agreement by: (1)
         the Company; (2) the holders of at least two-thirds of the outstanding
         shares of Series A Convertible Preferred Stock, voting as a separate
         class; (3) the holders of at least majority of the outstanding shares
         of Series B Convertible Preferred Stock, voting as a separate class;
         (4) the holders
<PAGE>
         of at least two-thirds of the outstanding shares of Series C
         Convertible Preferred Stock, voting as a separate class; and (5) the
         holders of at least two-thirds of the outstanding shares of Series D
         Convertible Preferred Stock purchased under the Series D Convertible
         Preferred Stock Purchase Agreement, voting as a separate class.

                  (b) The provisions of Section 2 hereof shall become effective
         upon the execution of this Termination and Amendment Agreement by: (1)
         the Company; (2) Paul Bleicher; (3) the Paul A. Bleicher 1999
         Irrevocable Trust; and (4) the holders of at least two thirds of the
         outstanding shares of Series A Convertible Preferred Stock, Series B
         Convertible Preferred Stock, Series C Convertible Preferred Stock, and
         Series D Convertible Preferred Stock, voting together as a single
         class.

         4. Counterparts. This Termination and Amendment Agreement may be
executed by the parties hereto in separate counterparts, each of which once so
executed and delivered (including by facsimile) shall be considered an original,
but all such counterparts shall together constitute one and the same instrument.

         5. Governing Law. This Termination and Amendment Agreement shall be
governed by and construed and enforced in accordance with the laws of the State
of Delaware except as to its conflicts of laws principles.

         IN WITNESS WHEREOF, the parties have executed this Termination and
Amendment Agreement as of the day first above written.

                                   PHASE FORWARD INCORPORATED

                                   By:   /s/ Robert K. Weiler
                                         -------------------------------
                                         Robert K. Weiler
                                         President and Chief Executive Officer
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   SCHRODER VENTURES INTERNATIONAL
                                   LIFE SCIENCES FUND II LP1

                                   By:     Schroder Venture Managers Inc.,
                                           as General Partner

                                   By:     /s/ Gary Carr   /s/Douglas Mello
                                           ------------------------------------
                                           Name:  Gary Carr
                                           Title:  Director & Vice President

                                   SCHRODER VENTURES INTERNATIONAL
                                   LIFE SCIENCES FUND II LP2

                                   By:     Schroder Venture Managers Inc.,
                                           as General Partner

                                   By:     /s/ Gary Carr   /s/Douglas Mello
                                           ------------------------------------
                                           Name:  Gary Carr
                                           Title:  Director & Vice President

                                   SCHRODER VENTURES INTERNATIONAL
                                   LIFE SCIENCES FUND II LP3

                                   By:     Schroder Venture Managers Inc.,
                                           as General Partner

                                   By:     /s/ Gary Carr  /s/Douglas Mello
                                           ------------------------------------
                                           Name:  Gary Carr
                                           Title:  Director & Vice President
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   SCHRODER VENTURES INTERNATIONAL LIFE SCIENCES
                                   FUND II STRATEGIC PARTNERS L.P.

                                   By:     Schroder Venture Managers Inc.,
                                           as General Partner

                                   By:     /s/ Gary Carr  /s/Douglas Mello
                                           ------------------------------------
                                           Name:  Gary Carr
                                           Title:  Director & Vice President

                                   SCHRODER VENTURES INTERNATIONAL LIFE SCIENCES
                                   FUND II GROUP CO-INVESTMENT SCHEME

                                   By:     SITCO Nominees Ltd. - VC 01903,
                                           as nominee

                                   By:     /s/ Gary Carr  /s/Douglas Mello
                                           ------------------------------------
                                           Name:  Gary Carr
                                           Title:  Director & Vice President

                                   SCHRODER VENTURES INVESTMENTS LIMITED

                                   By:     SV (Nominees) Ltd.,
                                           as nominee

                                   By:     /s/  Alistair Boyle
                                           -------------------------------------
                                   Name:   Alistair Boyle
                                   Title:  Alternate to Laurence S. McNairn,
                                           Director
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   DLJ CAPITAL CORP.

                                   By:     /s/  Ronald M. Hunt
                                           -------------------------------------
                                           By:   Ronald M. Hunt
                                           Its:  Director

                                   DLJ ESC II, L.P.

                                   By:     DLJ LBO Plans Management Corporation
                                   Its:    General Partner

                                   By      /s/  Ronald M. Hunt
                                           -------------------------------------
                                           By:   Ronald M. Hunt
                                           Its:  Attorney in fact

                                   SPROUT CAPITAL VIII, L.P.

                                   By:     DLJ Capital Corp.
                                   Its:    Managing General Partner

                                   By:     /s/  Ronald M. Hunt
                                           -------------------------------------
                                           By:   Ronald M. Hunt
                                           Its:  Director

                                   SPROUT VENTURE CAPITAL, L.P.

                                   By:     DLJ Capital Corp.
                                   Its:    General Partner

                                   By:     /s/  Ronald M. Hunt
                                           -------------------------------------
                                           By:   Ronald M. Hunt
                                           Its:  Director

                                   THE SPROUT CEO FUND, L.P.

                                   By:     DLJ Capital Corp.
                                   Its:    General Partner

                                   By:     /s/ Ronald M. Hunt
                                           -------------------------------------
                                           By:  Ronald M. Hunt
                                           Its: Director
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   NORTH BRIDGE VENTURE PARTNERS V-A, L.P.

                                   By:     North Bridge Venture Management V,
                                           L.P., as General Partner

                                   By:     /s/  Illegible
                                           -------------------------------------
                                           General Partner

                                   NORTH BRIDGE VENTURE PARTNERS V-B, L.P.

                                   By:     North Bridge Venture Management V,
                                           L.P., as General Partner

                                   By:     /s/  Illegible
                                           -------------------------------------
                                           General Partner
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   THOMAS WEISEL CAPITAL PARTNERS, L.P.

                                   By:     Tailwind Capital Partners LLC,
                                           as General Partner

                                   By:     /s/ Laurence B. Sorrell
                                           -------------------------------------
                                           Name:     Laurence B. Sorrell
                                           Title:    Managing Partner

                                   THOMAS WEISEL CAPITAL PARTNERS
                                   EMPLOYEE FUND, L.P.

                                   By:     Tailwind Capital Partners LLC,
                                           as General Partner

                                   By:      /s/ Laurence B. Sorrell
                                           -------------------------------------
                                           Name:     Laurence B. Sorrell
                                           Title:    Managing Partner

                                   TWP CEO FOUNDERS CIRCLE (QP), L.P.

                                   By:     Tailwind Capital Partners LLC,
                                           as General Partner

                                   By:     /s/  Douglas M. Karp
                                           -------------------------------------
                                           Name:     Douglas M. Karp
                                           Title:    Managing Partner

                                   TWP CEO FOUNDERS CIRCLE (AI), L.P.

                                   By:     Tailwind Capital Partners LLC,
                                           as General Partner

                                   By:     /s/ Laurence B. Sorrell
                                           -------------------------------------
                                           Name:     Laurence B. Sorrell
                                           Title:    Managing Partner
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   TWP 2000 CO-INVESTMENT FUND, L.P.

                                   By:     Thomas Weisel Capital Management LLC,
                                           as General Partner

                                   By:     /s/  Jack Helfund
                                           -------------------------------------
                                           Name:     Jack Helfund
                                           Title:    Associate General Counsel

                                   THOMAS WEISEL CAPITAL PARTNERS (DUTCH), L.P.

                                   By:     Thomas Weisel Capital Partners LLC
                                           (Dutch), as General Partner

                                   By:     Tailwind Capital Partners LLC,
                                           as General Partner

                                   By:     /s/ Laurence B. Sorrell
                                           -------------------------------------
                                           Name:     Laurence B. Sorrell
                                           Title:    Managing Partner

                                   THOMAS WEISEL CAPITAL PARTNERS (DUTCH II),
                                   L.P.

                                   By:     Thomas Weisel Capital Partners LLC
                                           (Dutch), as General Partner

                                   By:     Tailwind Capital Partners LLC,
                                           as General Partner

                                   By:     /s/ Laurence B. Sorrell
                                           -------------------------------------
                                           Name:     Laurence B. Sorrell
                                           Title:    Managing Partner
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   ATLAS VENTURE FUND III, L.P.

                                   By:     Atlas Venture Associates III, L.P.,
                                           as General Partner

                                   By:     Atlas Venture Associates III, Inc.,
                                           as General Partner

                                   By:     /s/ Illegible
                                           -------------------------------------
                                           Name:
                                           Title:    V.P.

                                   ATLAS VENTURE ENTREPRENEURS' FUND III, L.P.

                                   By:     Atlas Venture Associates III, L.P.,
                                           as General Partner

                                   By:     Atlas Venture Associates III, Inc.,
                                           as General Partner

                                   By:     /s/ Illegible
                                           -------------------------------------
                                           Name:
                                           Title:    V.P.

                                   ATLAS VENTURE FUND V, L.P.

                                   By:     Atlas Venture Associates V, L.P.,
                                           as General Partner

                                   By:     Atlas Venture Associates V, Inc.,
                                           as General Partner

                                   By:     /s/ Illegible
                                           -------------------------------------
                                           Name:
                                           Title:    V.P.
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   ATLAS VENTURE PARALLEL FUND V-A, C.V.


                                   By:     Atlas Venture Associates V, L.P.,
                                           as General Partner

                                   By:     Atlas Venture Associates V, Inc.,
                                           as General Partner

                                   By:     /s/ Illegible
                                           -------------------------------------
                                           Name:
                                           Title:    V.P.

                                   ATLAS VENTURE PARALLEL FUND V-B, C.V.


                                   By:     Atlas Venture Associates V, L.P.,
                                           as General Partner

                                   By:     Atlas Venture Associates V, Inc.,
                                           as General Partner

                                   By:     /s/ Illegible
                                           -------------------------------------
                                           Name:
                                           Title:    V.P.

                                   ATLAS VENTURE ENTREPRENEURS' FUND V, L.P.

                                   By:     Atlas Venture Associates V, L.P.
                                           as General Partner

                                   By:     Atlas Venture Associates V, Inc.
                                           as General Partner

                                   By:     /s/ Illegible
                                           -------------------------------------
                                           Name:
                                           Title:    V.P.
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   ABS CAPITAL PARTNERS, L.P.

                                   By:     ABS Partners, L.P.,
                                           as General Partner

                                   By:     /s/  Donald B. Hebb, Jr.
                                           -------------------------------------
                                           Name:     Donald B. Hebb, Jr.
                                           Title:    Managing Partner

                                   ABS CAPITAL PARTNERS II, L.P.

                                   By:     ABS Partners II, LLC,
                                           as General Partner

                                   By:     /s/  Donald B. Hebb, Jr.
                                           -------------------------------------
                                           Name:     Donald B. Hebb, Jr.
                                           Title:    Managing Partner
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   HLM/UH FUND, L.P.

                                   By:      HLM Management Co. Inc,
                                            its Manager


                                   By:     /s/ Peter Grua
                                           -------------------------------------
                                           Name:  Peter Grua
                                           Title:  President

                                   PACIFIC VENTURE GROUP II, L.P.

                                   By      PVG Equity Partners II LLC
                                           its General Partner

                                   By:
                                           -------------------------------------
                                           Name:
                                           Title:

                                   PVG ASSOCIATES II, L.P.

                                   By:     PVG Equity Partners II LLC
                                           its General Partner

                                   By:
                                           -------------------------------------
                                           Name:
                                           Title:

                                   BIOVENTURES INVESTORS LIMITED PARTNERSHIP

                                   By      BioVentures Investors, LLC,
                                           its General Partner

                                   By:     /s/ Marc Goldberg
                                           -------------------------------------
                                           Name:  Marc Goldberg
                                           Title:  Managing Director
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   ST. PAUL FIRE AND MARINE
                                   INSURANCE COMPANY

                                   By:
                                           -------------------------------------
                                           Name: James R. Simons
                                           Title: Authorized Representative


                                   ST. PAUL VENTURE CAPITAL IV, LLC

                                   By:
                                           -------------------------------------
                                           Name: James R. Simons
                                           Title: Managing Member

                                   ST. PAUL VENTURE CAPITAL V, LLC

                                   By:
                                           -------------------------------------
                                           Name: James R. Simons
                                           Title: Managing Member

                                   ST. PAUL VENTURE CAPITAL VI, LLC

                                   By:  SPVC Management VI, LLC
                                   Its: Managing Member

                                   By:
                                           -------------------------------------
                                           Name: James R. Simons
                                           Title: Managing Director

                                   HOUSATONIC EQUITY INVESTORS SBIC, L.P.

                                   By:  Housatonic Equity Partners SBIC, LLC,
                                   its general partner

                                   By:     /s/  Barry D. Reynolds
                                           -------------------------------------
                                           Name: Barry D. Reynolds
                                           Title: Managing Director
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   ONSET ENTERPRISE ASSOCIATES, L.P.

                                   By:     OEA Management, L.P. its general
                                           partner


                                   By:     /s/ Terry Opdendyk
                                           -------------------------------------
                                           Name:  Terry Opdendyk
                                           Title:  General Partner

                                   ONSET ENTERPRISE ASSOCIATES II, LP

                                   By:     OEA II Management, L.P. its general
                                            partner

                                   By:     /s/ Terry Opdendyk
                                           -------------------------------------
                                           Name:  Terry Opdendyk
                                           Title:  General Partner

                                   ONSET VENTURES SERVICES CORPORATION

                                   By:     /s/ Terry Opdendyk
                                           -------------------------------------
                                           Name:  Terry Opdendyk
                                           Title:  General Partner

                                   SALIX VENTURES, L.P.

                                   By:     Salix Partners LLC, its general
                                           partner

                                   By:     /s/ Christopher Grant, Jr.
                                           -------------------------------------
                                           Name:  Christopher Grant, Jr.
                                           Title:  Managing Member
<PAGE>
              Signature Page To Termination and Amendment Agreement


                                   NEW ENTERPRISE ASSOCIATES VI, LP

                                   By:     NEA Partners VI, Limited Partnership
                                            its general partner

                                   By:     /s/ C. Richard Kramlich
                                           -------------------------------------
                                           Name:  C. Richard Kramlich
                                           Title:  General Partner

                                   ELI LILLY AND COMPANY

                                   By:
                                           -------------------------------------
                                           Name:
                                           Title:

                                   INTERNATIONAL BUSINESS MACHINES CORPORATION

                                   By:
                                           -------------------------------------
                                           Name:
                                           Title:

                                   By:
                                           -------------------------------------
                                           Paul Bleicher

                                   PAUL A. BLEICHER 1999 IRREVOCABLE
                                   TRUST

                                   By:
                                           -------------------------------------
                                           Name:
                                           Title: