WASHINGTON — Goldman Sachs has agreed to pay nearly $12 million to settle civil charges accusing one of its executives of providing campaign services to a Massachusetts official in return for bond business.

The Securities and Exchange Commission also charged former Goldman Sachs vice president Neil M.M. Morrison with trying to influence the awarding of state contracts through campaign work for former Massachusetts Treasurer Timothy Cahill.

Morrison campaigned for Cahill from his Goldman Sachs office using company phones and email between November 2008 and October 2010, the SEC said. The services weren’t reported by Goldman Sachs, the SEC said. The company earned more than $7.5 million in fees from underwriting Massachusetts bond sales after Morrison’s activities, the agency noted.

Goldman Sachs fired Morrison in December 2010.

By law, firms are banned from underwriting municipal bond sales within two years of making any contribution to an official of the government issuing the bonds.

Regulators have issued warnings for years over so-called “pay-to-play” arrangements between investment firms and state and local government officials in the awarding of contracts for business in the $2.7 trillion municipal bond market. The market is tapped by governments around the country to finance schools, roads, hospitals and public works projects.

The SEC has brought a number of such cases against Wall Street banks and other investment firms, often involving campaign contributions or other payments. However, the new Goldman Sachs case marked the first time the agency accused a company of making non-cash contributions to a political campaign.

“Municipal finance professionals who use their firm’s resources to campaign on behalf of political candidates compromise themselves and the firms that employ them,” SEC Enforcement Director Robert Khuzami said in a statement.

Goldman Sachs agreed to pay a $3.75 million fine and about $8.2 million in restitution plus interest. The SEC said the $11.95 million Goldman Sachs is paying was the largest settlement amount it had ever won in a case involving “pay-to-play” violations.

Goldman Sachs neither admitted nor denied the allegations but it did agree to refrain from future such violations. The company also was censured by the SEC. Censure brings the possibility that Goldman Sachs could face a stiffer sanction if the alleged violation is repeated.

“We detected Morrison’s activities, promptly alerted regulators, terminated his employment and fully cooperated with the investigations,” Goldman Sachs said in a statement. “We accept responsibility for the consequences of his unauthorized actions under the terms of the settlements announced today and are pleased to resolve these investigations.”