Purpose: Children with autism spectrum disorders (ASDs) and children with developmental language disorder (DLD) face challenges with pragmatics, but the nature and sources of these difficulties are not fully understood yet. The purpose of this study was to compare the competence of children with ASD and children with DLD in two pragmatics tasks that place different demands on theory of mind (ToM) and structural language. Method: Twenty Spanish-speaking children with ASD, 20 with DLD, and 40 age- and language-matched children with neurotypical development were assessed using two pragmatics tasks: a linguistic pragmatics task, which requires competence with structural language, and a social pragmatics task, which requires competence with ToM as well. Results: For linguistic pragmatics, the ASD group performed similarly to the DLD and language-matched groups, and performance was predicted by structural language. For social pragmatics, the ASD group performed lower than the DLD and language-matched groups, and performance was predicted both by structural language and ToM. Conclusions: Children with ASD and children with DLD face difficulties in linguistic pragmatics tasks, in keeping with their structural language. Children with ASD face exceptional difficulties with social pragmatics tasks, due to their difficulties with ToM. The distinction between linguistic and social pragmatic competences can inform assessment and intervention for pragmatic difficulties in different populations.