The process of star formation from metal-free gas is investigated by following the evolution of accreting protostars with emphasis on the properties of massive objects . The main aim is to establish the physical processes that determine the upper mass limit of the first stars . Although the consensus is that massive stars were commonly formed in the first cosmic structures , our calculations show that their actual formation depends sensitively on the mass accretion rate and its time variation . Even in the rather idealized case in which star formation is mainly determined by \dot { M } _ { acc } , the characteristic mass scale of the first stars is rather uncertain . We find that there is a critical mass accretion rate \dot { M } _ { crit } \simeq 4 \times 10 ^ { -3 } M _ { \sun } { yr } ^ { -1 } that separates solutions with \dot { M } _ { acc } < \dot { M } _ { crit } in which objects with mass \gg 100 M _ { \sun } can form , provided there is sufficient matter in the parent clouds , from others ( \dot { M } _ { acc } > \dot { M } _ { crit } ) where the maximum mass limit decreases as \dot { M } _ { acc } increases . In the latter case , the protostellar luminosity reaches the Eddington limit before the onset of hydrogen burning at the center via the CN-cycle . This phase is followed by a rapid and dramatic expansion of the radius , possibly leading to reversal of the accretion flow when the stellar mass is about 100 M _ { \sun } . Under a realistic time dependent accretion rate that starts at high values ( \sim 10 ^ { -2 } M _ { \sun } yr ^ { -1 } ) and decreases rapidly in the high mass regime ( M _ { \ast } \gtrsim 90 M _ { \sun } ) , the evolution follows the case of \dot { M } _ { acc } < \dot { M } _ { crit } and accretion can continue unimpeded by radiation forces . Thus , the maximum mass is set by consideration of stellar lifetimes rather than by protostellar evolution . In this case , the upper limit can be as high as \sim 600 M _ { \sun } . We consider also the sensitivity of the results to the presence of heavy elements with abundances in the range Z = 5 \times 10 ^ { -5 } Z _ { \sun } to 5 \times 10 ^ { -3 } Z _ { \sun } . The main evolutionary features of protostars are similar to those of metal-free objects , except that the value of \dot { M } _ { crit } increases for metal-enriched protostars . Since the accretion rate is lower in a slightly polluted environment , the condition \dot { M } _ { acc } < \dot { M } _ { crit } is expected to be more easily met . We find that for metallicities below \sim 10 ^ { -2 } Z _ { \sun } , where radiation forces onto dust grains in the flow are negligible , a slightly metal-rich gas favors continued accretion and the formation of very massive stars .