Rep. Michael Capuano, center, and Boston city counselor Ayanna Pressley squared off in their final debate for the Massachusetts 7th District seat before next month’s Democratic primary. (WGBH)

Boston city counselor Ayanna Pressley accused Rep. Michael Capuano on Wednesday of hewing too close to the right on issues including criminal justice, police protests and funding for a proposed border wall Wednesday in the final debate of one of Massachusetts’ most closely watched House primaries.

Both candidates are left-leaning liberals who have acknowledged that they often agree. But they have taken on more aggressive stances as the clock ticks down in a race that has attracted national attention as the next to potentially shake up the Democratic Party.