headaches are really non-specific. they can occur with hundreds of illnesses and conditions. ibuprofen (motrin) reduces fever and pain (including headache pain) so this was the normal response to using this medication.
can children get headaches with the onset of a fever? after giving motrin the fever came down and the headache went away