BHP's half-year profits were $3.24bn (Â£2.6bn), up from $412m a year earlier.
Chief executive Andrew MacKenzie said told the BBC the strong results were also helped by improved productivity.
Anglo American reported full-year profits of $1.6bn compared with a $5.6bn loss in 2015.
BHP's Mr MacKenzie said the results followed a five-year plan to "improve productivity and redesign our portfolio and operating model".
"Our steadfast commitment to this plan has positioned us to take full advantage in a period of higher prices," he added.
The price of some commodities has risen, in part because of increased demand from China. Iron ore has risen by more than 80% and coal by up to 300%.
However, Mr MacKenzie said there was another factor at play: "China's improved a little bit but I would say much of what's going on in terms of the iron ore price is down to less production of iron ore elsewhere and companies like us have been able to fill that gap.
"The Chinese economy is going quite strongly at the moment, partly down to stimulus that was stated probably about three quarters back, and that has really pushed up the premia for high quality iron ore and metallurgical coal and they're our principle products."
But in its statement, BHP said China's economic growth was expected to moderate in the coming year, with the housing and car markets expected to cool. It also said "exports may be challenged by the rising threat of protectionism".
BHP's results included a $155m charge relating to the Samarco mining disaster in Brazil, which killed 19 people.
"Providing our support for the long-term recovery of the communities and environment affected by the Samarco tragedy on 5 November 2015 remains a priority for BHP Billiton," the company said.
"Substantial progress has been made on community resettlement, community health and environment restoration."
BHP Billiton's surge back in to the black is primarily thanks to an increase in the price of the things it digs out of the ground - iron ore, coal, and so on.
Iron ore has doubled in price over the past year. BHP's results out today say the company benefited to the tune of Â£3.9bn because of higher average commodity prices. Yet the boss, Andrew Mackenzie, was irritated when I pointed this out in a radio interview with him. He told me it's the hard work of him and his workforce that's returned the business to profit (last year was a monumental loss).
"This is a strong set of results we've been working at for the better part of four or five years," he told me. Indeed the company has cut costs and sold off various part of the business. "Much is down to what we've done in improving our safety and productivity".
But it's impossible to get away from the fact that miners' profits are driven by the price of commodities. BHP has got other things to worry about as well. There's a large strike at its Escondida copper mine in Chile.
It's still cleaning up after a disaster at its part-owned Samarco mine in Brazil. It wiped out a town, killed 19 people and polluted miles of Brazil's waterways. Reputational costs aside, the financial bill for that could run to the tens of billions of pounds.
Anglo American was among the mining companies worst hit by the 2015 fall in commodity prices.
However, when prices picked up last year, its shares recovered strongly to become the top performer on the FTSE 100 share index.
"We continue to benefit from the performance of a number of other world class assets across the bulk commodities of iron ore and coal, as well as nickel," said the company's chief executive, Mark Cutifani.
But, as with BHP, its swing from loss to profit is also down to cost cutting measures, and the sale of some mines.
"The decisive and wide-ranging operational, cost, capital and portfolio actions we set out in 2016 - to sustainably improve cash flows and strengthen the balance sheet - have enabled us to reduce net debt by 34% to $8.5bn." said Mr Cutifani.
Two of the world's biggest mining companies, BHP Billiton and Anglo American, have reported a sharp increase in profits, boosted in part by the rise in commodity prices.