Sperm production is physiologically costly; therefore, males that mate multiple times are expected to allocate sperm prudently to maximize their fitness. Sperm allocation theory has been widely tested in internally fertilizing animals; however, few studies have investigated whether males adjust the number of sperm released according to their premating experience and cues from rival males. Here, we investigated sperm allocation strategies in an externally fertilizing fish, the medaka, Oryzias latipes, in controlled conditions. We used three treatments: direct interaction with a rival (two males were allowed to interact directly with each other), visual cue only (presenting a male in a separate compartment) and no rivals (control). In the direct interaction treatment, two types of alternative male mating behaviour, simultaneous sperm release and postspawn sperm release, were observed. Premating experiences affected subsequent mating behaviour: males that were more aggressive and exhibited more prominent courtship behaviour mated females without any disturbance from the other males, whereas simultaneous sperm release frequently occurred when both males exhibited similar levels of aggression and courtship behaviours. We also counted the sperm released per mating from the water tank. There was no change in the number of sperm released in the presence of visual cues of competition or direct interaction with the other males before mating. However, males (focal and/or rival) released more sperm only when sperm competition was high, that is, when a rival male successfully disrupted mating before simultaneous sperm release. Our results indicate that medaka males may adjust the number of sperm released per mating in different mating environments.