WASHINGTON — Senator John F. Kerry and his wife, seeking to avoid possible conflicts of interest, will sell nearly 100 separate investments in the United States and abroad if the Massachusetts Democrat is confirmed as secretary of state.

Kerry will appear before the Senate Foreign Relations Committee on Thursday for his confirmation hearing, in which he is likely to face multiple questions of about his views on foreign policy and the direction he wants to take US diplomacy in President Obama’s second term.

Kerry said he and his wife, Teresa Heinz Kerry, pledged to divest shares in such companies as a Canadian oil firm and defense contractor Raytheon Co., and in a series of international equity funds, according to an agreement reached with the Obama administration and released Wednesday.

The decision to relinquish the assets within 90 days of taking the oath of office came after an independent review by the Office of Government Ethics determined that some of the Kerrys’ vast international holdings could run afoul of ethics laws in his new Cabinet post.

A prerequisite for the job, government lawyers concluded, is that he and Heinz Kerry, the heir to the ketchup fortune, sever a series of financial ties that could raise ethics questions.

“I am committed to the highest standards of ethical conduct for government officials,” Senator Kerry wrote in the agreement with the State Department’s ethics office.

As for other holdings, such as his wife’s stock in the H.J. Heinz Co., Kerry pledged to “not participate personally and substantially in any particular matter that has a direct and predictable effect on my financial interests or those of any person whose interests are imputed to me, unless I first obtain a written waiver.”

Kerry, who is expected to win speedy confirmation from fellow senators, also agreed to resign from his position at the American Security Project, a think tank he help found in 2007, as well as his advisory role at the Harvard Kennedy School’s Institute of Politics.

But the greatest concern was a number of investments — in the form of outright stock or as part of family trusts — that could be directly affected by decisions he makes as secretary of state on trade agreements, security contracts, or other transnational arrangements.

For example, the divestitures will include his shares of Cenovus Energy Inc., the Canadian company that would benefit from the proposed Keystone XL pipeline.

His wife, meanwhile, will sell her interests in the so-called Sustainable Technologies Fund, a private equity fund that invests in alternative energies such as wind power.

In both instances, his decisions or recommendations to the Obama administration could conceivably benefit such investments.

Kerry was also advised to dump a series of other energy-related holdings, according to the documents, including shares of ConocoPhillips, ExxonMobil, BP, and the electric and gas provider Wisconsin Energy Corp.

A pair of Kerry’s family trusts, which are separate from his wife’s, will also be divested of shares in Waltham-based defense giant Raytheon Co.; Pentagon contractor United Technologies; drug maker Pfizer; communications giant Qualcomm Inc.; and American Express, among others.

The Kerry investments slated to be sold touch on a variety of other industries including computer software, banking, fast food, and food packaging. Among them are shares in Boston investment bank State Street Corp.

The Massachusetts senator has also been advised to recuse himself from certain matters involving the H.J. Heinz Co. because the Kerrys’ investments in company stock are greater than in other publicly traded firms, according to the ethics documents.

That includes Heinz Co. holdings in Italy, New Zealand, The Netherlands, Australia, Canada, the United Kingdom, Cyprus, France, Venezuela, Indonesia, and India.

Kerry will be introduced on Thursday to the Senate Foreign Relations Committee by the trio of outgoing Secretary of State Hillary Rodham Clinton; Senator Elizabeth Warren, the Massachusetts Democrat; and Senator John McCain, the Arizona ­Republican who, like Kerry, served in Vietnam.

Kerry spent Wednesday in his so-called “hideaway” US Capitol office preparing for his confirmation hearing and watching Clinton testify on the terrorist attacks on the US consulate in Benghazi, Libya, in September.

Kerry, who will remain chairman of the Foreign Relations Committee until confirmed, also attended what is likely his last official lunch with fellow committee chairmen.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.

Thanks & Welcome to Globe.com

You now have unlimited access for the next two weeks.

BostonGlobe.com complimentary digital access has been provided to you, without a subscription, for free starting today and ending in 14 days. After the free trial period, your free BostonGlobe.com digital access will stop immediately unless you sign up for BostonGlobe.com digital subscription. Current print and digital subscribers are not eligible for the free trial.