Dogs exhibit human-analogue attachment to their owners, with similar function and mechanisms to that of infant-mother bond, but its origin is unclear. Comparative studies on socialised wolves and dogs emphasise genetic influence in dogs' preparedness for attachment to humans. We aimed to reveal if this genetic effect stems from general domestication or artificial selection that increased dogs' dependence on humans. We assessed and compared behavioural patterns of young companion pigs and dogs using a Strange Situation Test. Dogs but not pigs exhibited distinct behaviours towards their owner and a stranger along attachment-specific variables, so only dogs’ relevant behaviours fulfilled attachment criteria. From the observed behaviours, three factors were formed: Attachment (to the owner), Anxiety (in a strange situation), and Acceptance (of a stranger). Results indicate (1) higher Attachment scores in dogs than pigs, (2) greater Acceptance scores in pigs, (3) positive correlation of Attachment and Anxiety in both, (4) similar time tendency of pigs' Attachment and Acceptance scores. These suggest that in pigs, domestication and early exposure to human social stimuli did not trigger attachment to humans. Thus, along with species predispositions, the unique dog-owner attachment can be facilitated by artificial selection that increased dogs' dependence on humans.