Ketamine or a physiologically acceptable salt thereof for use in the treatment of a somatoform pain disorder according to the ICD-10 F45.4 definition including the sub-forms: persistent somatoform pain disorder according to the ICD-10 F45.40 definition, and chronic pain disorder with somatic and psychological factors according to the ICD-10 45.41 definition, is provided. The ketamine or the physiologically acceptable salt thereof, in particular ketamine HCl, may be administered orally, sublingually or nasally. A pharmaceutical dosage form comprising ketamine or a physiologically acceptable salt thereof for use in the treatment of somatoform pain disorder according to the ICD-10 F45.4 definition including the sub-forms: persistent somatoform pain disorder according to the ICD-10 F45.40 definition, and chronic pain disorder with somatic and psychological factors according to the ICD-10 45.41 definition, is also provided.