OTTAWA -- The Federal Court has ordered the lobbying commissioner to take another look at whether the Aga Khan broke the rules by giving Prime Minister Justin Trudeau a vacation in the Bahamas.

In September 2017, then-commissioner Karen Shepherd said there was no basis to a complaint from an unnamed member of the public that the Aga Khan, a billionaire philanthropist, had violated the code for lobbyists by allowing Trudeau and his family to stay on his private Caribbean island.

Shepherd's office found no evidence the Aga Khan was "remunerated for his work" as a director of a foundation registered to lobby the federal government, and therefore concluded the code did not apply to his interactions with Trudeau.

Although Democracy Watch was not the original complainant, the Ottawa-based group challenged the ruling in Federal Court.

Democracy Watch argued Shepherd should have considered that as a board member of the Aga Khan Foundation Canada, the spiritual leader of the world's Ismaili Muslims was directly and legally connected to the organization bearing his name and was acting as its representative in giving a gift to the prime minister.

In his decision made public this week, Federal Court Justice Patrick Gleeson noted the commissioner concluded there was no evidence the Aga Khan was "renumerated" for his work with the foundation. However, the Lobbying Act sets out obligations that lobbyists incur when they undertake activities "for payment" -- a term defined in the act as including "anything of value."

The commissioner's analysis does not consider whether the Aga Khan may have received anything of value, but begins and ends with the simple question of monetary payment, Gleeson said. Restricting the analysis to this narrow question is inconsistent with both the wording of the act and the objects and purposes of the code, he added.

In addition, the analysis excluded any consideration of possible compliance issues relating to the foundation, its senior officer or its other registered lobbyists.

The commissioner was required to take a broad view of the circumstances in addressing the complaint, Gleeson said.

"Instead, the record before the Court reflects a narrow, technical and targeted analysis that is lacking in transparency, justification and intelligibility when considered in the context of the Commissioner's duties and functions," he wrote. "The decision is unreasonable."

Gleeson directed Nancy Belanger, who was appointed as the new lobbying commissioner in December 2017, to re-examine the matter.

Speaking after an event Tuesday in Kitchener, Ont., Trudeau said he had trust in "the processes in place" and respected the coming review by the commissioner.

In December 2017, Mary Dawson, federal ethics commissioner at the time, found Trudeau contravened four sections of the Conflict of Interest Act in relation to the Christmas 2016 vacation. She found the holiday could reasonably be seen as a gift designed to influence the prime minister.

Opposition parties argued Trudeau should refund the treasury for all or part of the transportation and security costs related to the trip.

Trudeau acknowledged he should have checked with the ethics commissioner's office before accepting the holiday, and said he would now clear all family vacations with the commissioner.

"I've always considered the Aga Khan a close family friend, which is why I didn't clear this family trip in the first place, but given the commissioner's report, I will be taking all precautions in the future," Trudeau said in 2017.