Only if the effort is sincere, say two major firms that specialize in evaluating companies’ stock market prospects based on their social-responsibility credentials. And that is good news for Royal Dutch/Shell. The world’s second-biggest oil company is scoring high marks for an environmental attitude change. Sustainable Asset Management, the Zurich firm that supplies the research behind the Dow Jones Sustainability Index, ranks Shell No. 1 in the oil industry. New York’s Innovest, borrowing a ratings platform from S&P, rates Shell AAA; Exxon, the largest oil company, gets only a BBB.

The endorsements are certainly gratifying for Shell, which is 60% owned by Royal Dutch Petroleum ($ 47, RD) of the Netherlands and 40% owned by London’s Shell Transport ($ 40, SC). In recent years the firm has spent significant energy cleaning up its environmental and social-responsibility record. Aside from keeping its green and human-rights critics at bay, says Shell Chairman Phil Watts, the company’s new attitude is also the best way to make money. “There is no other way to [operate] if you’re going to have a sustainable business,” says Watts, sitting in his 23rd-floor office overlooking the Thames.

The oil giant’s conversion resulted from two disastrous events in 1995. Almost simultaneously Shell stations in Germany were attacked over the company’s plans to sink an oil rig called Brent Spar in the North Sea, and Shell was blamed for the execution of Nigerian author Ken Saro-Wiwa, who had protested Shell’s environmental record in his country. “It was a real wake-up call,” says Watts.

To understand how it had so badly mangled its public image, Shell commissioned a global survey of society’s expectations. The company then hired KPMG to collect and audit statistics on a range of issues. Since 1997 its annual Shell Report has recorded its polluting emissions, its energy efficiency, and a slew of other statistics meant to quantify its social performance much as an annual report does.

In many cases the desire to bolster its green record has helped Shell boost the bottom line. For instance, to reduce carbon dioxide emissions in Nigeria, long a trouble spot for Shell, the company stopped flaring excess gas from oil wells. That led Shell to build liquefied natural gas facilities. “It turns out that’s profitable because we sell the gas instead of flaring,” says Watts. By 2008, Shell plans to eliminate continual flaring everywhere.

Behind the high ratings from SAM and Innovest is the belief that better social performance indicates more-responsible leadership. “How a company is doing on these issues is an excellent indicator of stock market performance because it indicates the overall quality of the management,” says Frank Dixon, head of research at Innovest.

And considering that Shell has a healthy balance sheet, a credit rating of AAA, a generous dividend, and a P/E below the industry average, betting on its green record makes pretty good eco-sense.