Things are starting to turn around at FBR & Co. as a series of cost-cutting measures helped the Arlington investment bank swing a profit in the second quarter, despite declines in revenue.

FBR, once the region’s largest home-grown investment house, has battled back from severe losses in subprime mortgage investments made by its predecessor — Friedman, Billings, Ramsey Group. The company has shrunk its workforce and shut down several business units to improve finances. Yet sluggish activity in the capital markets continues to weigh heavy on the firm.

In the three months ending June, FBR recorded $491,000, or 1 cent a share, in profit, compared with a loss of $2.7 million, or 5 cents a share, a year earlier. That modest income marks the second consecutive quarter of profit. Revenue, however, tumbled 25 percent to $33.7 million.

“We’re still operating in a very difficult environment, but our activity level in the first half of the year was even better than our financial results,” said FBR chief executive Richard Hendrix.

He pointed out that the company completed its largest transaction of the year in the second quarter, raising $550 million to fund the creation of mortgage insurer NMI Holdings in April. The deal, however, did not factor into earnings because NMI is still awaiting regulatory approval.

“If the revenue had been in the first half, it would be easier for people to see that we actually had a very good first half even in a tough environment,” Hendrix said. “We’re in a much better position than we have been in a long time.”

FBR’s investment banking team completed 12 transactions in the second quarter, including raising money for eight companies and completing four financial advisory deals. It generated $19 million in revenue, down from $30 million a year ago. Meanwhile, the institutional brokerage arm earned $12.3 million in revenue, nearly half of what it took in at the same time last year.

“It was a challenging quarter, but earnings were still positive, reflecting significant progress from last year,” said analyst Devin Ryan of Sandler O’Neill Partners. He said the firm’s fate is inextricably linked to the performance of the securities market,“but we believe its profitability picture for 2012 is much brighter than a year ago.”

FBR’s profitability has hinged on its ability to keep expenses low. At the end of June, the company counted 259 employees on its staff, down from 423 at the same time a year earlier. That reduction helped drive expenses from operations down 30 percent to $33.4 million. Hendrix said the company doesn’t anticipate any significant reductions from here on out.

A part of the reduction in staff is attributed to the pending sale of FBR’s asset management business to Hennessy Advisors. That arm of the company, with 17 employees, included 10 mutual funds with assets in excess of $1.9 billion.

Asset management, Hendrix said, “has been a business that delivered great performance for investors over the years, but it wasn’t big enough to generate significant profit for us. Yet it’s a valuable business.”

FBR expects the sale will generate $30 million in proceeds once it closes in the fourth quarter. It will redeploy the money into its capital markets business and buy back some stock. Hendrix said he is content with the current size and breadth of FBR’s operations.

“With the cost structure that we have today, even in a difficult market we are now structured to perform,” he said. “We’re going to continue to focus on the capital markets business in the industries where we’ve had long-term success: financial services, energy, real estate, industrial.”