Tan and Machin (biStat. Med. 2002; 21:1991–2012) introduce a Bayesian two-stage design for phase II clinical trials where the binary endpoint of interest is treatment efficacy. In this paper we propose an extension of their design to incorporate safety considerations. At each stage we define the treatment successful and deserving of further study if the total number of adverse events is sufficiently small and the number of responders who simultaneously do not experience any toxicity is sufficiently large. Therefore, our criterion is based on the joint posterior probability that the true overall toxicity rate and the true efficacy-and-safety rate are, respectively, smaller and larger than conveniently pre-specified target values. The optimal two-stage sample sizes are determined specifying a minimum threshold for the above-mentioned posterior probability, computed under the assumption that favorable outcomes have occurred. Besides describing the proposed design, we suggest how to construct informative prior scenarios and we also apply the reference algorithm to derive a non-informative prior distribution. Finally, some numerical results are provided and a real data application is illustrated. Copyright © 2011 John Wiley & Sons, Ltd.