In his decision, Justice Stephen Goudge said the obligation to provide the materials is clear from the settlement agreement that established the commission.
"The plain meaning of the language is straightforward," Goudge said. "It is to provide all relevant documents to the TRC."
The decision comes in an increasingly acrimonious dispute between Ottawa and the commission over millions of government documents the commission says it needs to fulfil its core mandate.
The government maintained it had no obligation to provide the records in Library and Archives Canada.
The commission, under Justice Murray Sinclair, argued Ottawa's intransigence would make it impossible to complete its work on budget as required by July 1, 2014.
"We're grateful to be able to continue the commission's work of gathering and protecting for future generations documents that are relevant to the history of the Indian residential schools," Sinclair said in a statement.
"We especially acknowledge the clarity of Justice Goudge's decision."
Part of the commission's mandate is to help in a process of reconciliation, while yet another is the "creation of a legacy" that includes collection of records, taking statements from those involved, and classifying and preserving the materials.
"Canada's documents, wherever they were held, would have been understood as a very important historical resource for this purpose," Goudge said.
The residential school system, which ran from the 1870s until the 1990s, saw about 150,000 native kids taken from their families and sent to church-run schools under a deliberate policy of "civilizing" First Nations.
Many students were physically, mentally and sexually abused. Some committed suicide. Mortality rates reached 50 per cent at some schools.
In the 1990s, thousands of victims sued the churches that ran the schools and the Canadian government. The $1.9-billion settlement of that suit in 2007 prompted an apology from Prime Minister Stephen Harper and the creation of the commission.
In its submissions to the court, the commission argued the Canadian government was trying to renege on its legal deal with Aboriginal Peoples because sticking to the terms would cost too much.
Lawyer Julian Falconer, who represented the commission, called it a "truly landmark" judgment.
"The court's answers to the commission's reference will ensure that the dark chapter in Canadian history that is the residential school story will never be forgotten," Falconer said.
In opposing the court application, the federal government argued the commission had no legal standing to take the matter to court.
It also maintained its only obligation was to throw open the doors to the Library and Archives Canada to commission researchers.
Goudge disagreed on both counts.
"While Canada is not obliged to turn over its originals, it is required to compile all relevant documents in an organized manner for review by the TRC," the justice said.
Goudge also weighed in on the dispute over
what constitutes "relevant" documents, saying not every document that mentions residential schools is key to the commission's mandate.
An evaluation of relevance is context specific and the obligation on the government to produce documents must be reasonable.
"Suffice it to say that Canada's obligation ... is to provide the documents in its possession or control that are reasonably required to assist the TRC to tell the story of the legacy of Indian residential schools," Goudge said.
Jason McDonald, spokesman for Aboriginal Affairs Minister John Duncan, said Goudge's decision was under review but the government would fulfil its obligations.
"Federal departments have already disclosed nearly one million documents," McDonald said.
In a statement, Shawn Atleo, national chief of the Assembly of First Nations, hailed the decision as a "significant victory."
"(The ruling) underscores the importance of the truth-telling and truth-sharing mandate of the Truth and Reconciliation Commission in assisting with the individual healing of former students, their families and our communities," Atleo said.
"(It) helps advance the steps required toward reconciliation for First Nations and all Canadians."