D.C.’s top financial official was questioned on Capitol Hill on Tuesday by lawmakers concerned about high-profile rip-offs of public dollars that city accountants failed to prevent.

Despite an improvement in the city’s credit rating and steps to increase accountability, the District needs to intensify anti-fraud controls, improve management of city contracts and do more to monitor its employees, the Senate subcommittee that oversees the District was told by the District’s chief financial officer, Natwar Gandhi.

The city’s financial turnaround over the past decade “is all for nothing if we do not instill a sense of ethics and accountability,” Gandhi said.

Sen. Daniel K. Akaka, D-Hawaii, asked Gandhi what could be done “to create a culture of integrity” in the city government.

Gandhi promised to strengthen oversight, both through internal programs such as ethics training and a fraud reporting hot line, and more vigilant external auditing.

Senators focused questioning of Gandhi on two major financial scandals that rocked city government.

Harriette Walters, a midlevel manager in the Office of Tax and Revenue, was arrested in late 2007 and pleaded guilty to a massive fraud that robbed the city of $50 million over two decades. Since then, the city has fired dozens of tax office employees, instituted stronger internal controls and began more thorough employee background checks.

More recently, two city officials and a contractor in D.C.’s technology office were arrested in a scheme involving phony invoices and ghost employees. Despite warnings dating back nearly two years, city officials failed to stop the multimillion-dollar scam.

District Inspector General Charles Willoughby testified Tuesday to a “need to address deficiencies” in the city’s financial practices, citing a January audit that found systemic problems with basic accounting functions and oversight in agencies citywide.

Medicaid filings were a particularly weak point.

With about a quarter of District residents eligible for Medicaid, the city has been quick to spend money but often fails to keep track of those expenditures, officials said. As a result, the city loses out on federal reimbursements, which are supposed to cover 70 percent of the District’s Medicaid spending.

Gandhi conceded to serious problems in Medicaid management, estimating they have cost the city $340 million over the last 10 years.

“We cannot afford that,” he told the senators.

Despite the fraud and costly management mistakes, Gandhi defended his overall record as the city’s top financial official.

He said the city council was finalizing the 14th consecutive balanced budget for fiscal 2010, even in the face of an estimated $800 million shortfall. The District recently received the highest possible credit rating from three major Wall Street ratings agencies. “One might say we’ve performed miracles,” Gandhi said.