The $500 million cement factory in the southeastern Tanzanian town of Mtwara, set up last year with an annual capacity of 3 million tonnes, runs on expensive diesel generators and has sought government support to reduce costs.
But the negotiations had stalled with the state-run Tanzania Petroleum Development Corporation (TPDC) saying the company was seeking "at-the-well prices".
After meeting Aliko Dangote, the company's chairman who is Africa's richest man, Magufuli blamed unspecified middlemen of interfering with supply plans and said the issue has now been resolved with gas supplies to be sold at a "reasonable" tariff.
"They (Dangote Cement) will now buy natural gas directly from the state-run TPDC instead of going through middlemen," Magufuli told journalists after the meeting.
He did not give details on the new tariff.
Dangote, Africa's biggest cement producer, has an annual production capacity of 43.6 million tonnes and targets output of between 74 million and 77 million tonnes by the end of 2019 and 100 million tonnes of capacity by 2020.
The company plans to roll out plants across Africa. In Tanzania, Dangote is seeking to double the country's annual output of cement to 6 million tonnes.
The country announced in February that it had discovered an additional 2.17 trillion cubic feet (tcf) of possible natural gas deposits in an onshore field, raising its total estimated recoverable natural gas reserves to more than 57 tcf.