Apart from the 11-year solar cycle, another periodicity around 155-160 days was discovered during solar cycle 21 in high energy solar flares, and its presence in sunspot areas and strong magnetic flux has been also reported. This periodicity has an elusive and enigmatic character, since it usually appears only near the maxima of solar cycles, and seems to be related with a periodic emergence of strong magnetic flux at the solar surface. Therefore, it is probably connected with the tachocline, a thin layer located near the base of the solar convection zone, where strong dynamo magnetic field is stored. We study the dynamics of Rossby waves in the tachocline in the presence of a toroidal magnetic field and latitudinal differential rotation. Our analysis shows that the magnetic Rossby waves are generally unstable and that the growth rates are sensitive to the magnetic field strength and to the latitudinal differential rotation parameters. Variation of the differential rotation and the magnetic field strength throughout the solar cycle enhance the growth rate of a particular harmonic in the upper part of the tachocline around the maximum of the solar cycle. This harmonic is symmetric with respect to the equator and has a period of 155-160 days. A rapid increase of the wave amplitude could give place to a magnetic flux emergence leading to observed periodicities in solar activity indicators related with magnetic flux.