For a mass-selected sample of 66544 galaxies with photometric redshifts (z phot) from the Cosmic Evolution Survey (COSMOS), we examine the evolution of star-formation activity as a function of stellar mass in galaxies. We estimate the cosmic star-formation rates (SFRs) over the range 0.2 < z phot < 1.2, using the rest-frame 2800 flux (corrected for extinction). We find the mean SFR to be a strong function of the galactic stellar mass at any given redshift, with massive systems (log(M/M ⊙)>10.5) contributing less (by a factor of 5) to the total star-formation rate density (SFRD). Combining data from the COSMOS and Gemini Deep Deep Survey, we extend the SFRD-z relation as a function of stellar mass to z 2. For massive galaxies, we find a steep increase in the SFRD-z relation to z 2; for the less-massive systems, the SFRD which also increases from z = 0 to 1 levels off at z 1. This implies that the massive systems have had their major star-formation activity at earlier epochs (z > 2) than the lower-mass galaxies. We study changes in the SFRDs as a function of both redshift and stellar mass for galaxies of different spectral types. We find that the slope of the SFRD-z relation for different spectral types of galaxies is a strong function of their stellar mass. For low- and intermediate-mass systems, the main contribution to the cosmic SFRD comes from the star-forming galaxies while, for more-massive systems, the evolved galaxies are the most dominant population.