BANGOR, Maine — Security along the longest international border in the world continues to be a high priority, but should be managed in a way that eliminates inefficiencies and duplication, according to a Canadian official who visited Bangor on Tuesday.

Aaron Annable, the Boston-based acting consul general of Canada to New England, spoke to a small luncheon gathering at Oriental Jade Restaurant in Bangor organized by the Bangor Foreign Policy Forum. He also spoke to a group of University of Maine students on Tuesday, primarily about the legacy of the North American Free Trade Agreement.

The border between the United States and Canada is more than 5,500 miles long, not including the 1,500-mile Canadian-Alaskan border, yet politicians and the media in the U.S. focus far less attention on the northern boundary than the southern one.

Still, the northern border is secure and not as “porous” as many assume, Annable said. After the terrorist attacks of Sept. 11, 2001, security was tightened in both populated and rural crossings and patrols were increased. Even isolated back roads between the countries have sensors to warn of crossings in secluded areas.

Security at the border continues to be an important goal, as recent events have shown neither the U.S. nor Canada is immune from attacks, Annable said. He cited the shootings on Parliament Hill in Ottawa and the Boston Marathon bombing as examples. Just two days before the Ottawa attack last month, a man who had expressed support for the Islamic State purposefully rammed his vehicle into two Canadian soldiers in Quebec, killing one.

IS has become a big area of concern and has sparked worry about home-grown terrorism conducted by sympathizers, Annable said. Canada has signed on to assist the U.S. and others in a coalition to stem the tide of IS using air strikes and intelligence, rather than ground troops.

“This seems to be something that sits well with most Canadians, that we should be a part of this coalition,” Annable said.

In 2012, the U.S. and Canada signed an agreement titled “Beyond the Border: A Shared Vision for Perimeter Security and Competitiveness,” aimed, in part, at collaborating to collect and share intelligence to identify potential threats before they ever reach border checkpoints, while eliminating some of the red tape that makes cross-border and international trade slow and costly.

“There’s been a lot of duplication in our security measures,” Annable said.

The agreement will continue to shape the future of border relations and security, he added.

Follow Nick McCrea on Twitter @nmccrea213.