Understanding influences on pedestrian movement is important to accurately simulate crowd behaviour, yet little research has explored the psychological factors that influence interactions between large groups in counterflow scenarios. Research from social psychology has demonstrated that social identities can influence the micro-level pedestrian movement of a psychological crowd, but this has not been extended to explore behaviour when two large psychological groups are co-present. This study investigates how the presence of large groups with different social identities can affect pedestrian behaviour when walking in counterflow. Participants (N = 54) were divided into two groups and primed to have identities as either ‘team A’ or ‘team B’. The trajectories of all participants were tracked to compare the movement of team A when walking alone to when walking in counterflow with team B, based on their i) speed of movement and distance walked, and ii) proximity between participants. In comparison to walking alone, the presence of another group influenced team A to collectively self-organise to reduce their speed and distance walked in order to walk closely together with ingroup members. We discuss the importance of incorporating social identities into pedestrian group dynamics for empirically validated simulations of counterflow scenarios.