He made the assertion on Monday while addressing members of the Nigerian community in Johannesburg, South Africa, where he also vowed that the All Progressives Congress (APC) will "kill" corruption in the country.
The president, who recalled his times as state governor, petroleum minister and military head of state, also explained that he repeatedly contested the presidency because of his belief in the practicability of conducting free and fair election in the country.
He expressed confidence in the unity of the country, saying that even though there are some 'crazy' people who talk about the disintegration of the country, the country will never break up.
Buhari stated: "How I wish I became Head of State when I was a governor, just a few years as a young man. Now at 72, there is a limit to what I can do.
"But what brought me there I think mainly is because I love this country. I was in the war front for 30 months during the civil war. I lost a lot of loyal people to me, I lost relatives. A lot of Nigerians did too.
"We lost about two million Nigerians just to keep Nigeria one. So, nobody should come now and tell us rubbish. We are going to remain one country. God has given us another opportunity to reorganise this country. Those who work hard, the society will pay them back."
He said he had been told that there were 83 Nigerians in South African jails, disclosing that he would discuss the matter with President Jacob Zuma during his planned visit to Nigeria in the near future.
Buhari also revealed that he would inquire from the South African president about the whereabouts of the $9.7 million the Goodluck Jonathan's administration had transferred to South Africa for the botched arms purchase.
The president added: "I refused to speak from this draft speech because I wanted to speak to you from the bottom of my heart. Please, keep Nigeria's pride close to your heart, make sure you behave yourselves. If you find yourselves here, obey their laws. Where you don't obey their laws, you will have to bear the consequences.
"I'm told they are 83 Nigerians in prison, I don't know what they have done but I spoke to the President of South Africa this afternoon. He wants to come to Nigeria. There are issues he knows to talk about, I will certainly talk to him.
"I hope our ambassador will send a comprehensive report about the court cases, about those who lost properties during the disturbances and at that time, I will attempt to ask him about our $9.7 million which was not correctly transferred."